Doubly-Linked-PP

 view release on metacpan or  search on metacpan

lib/Doubly/Linked/PP.pm  view on Meta::CPAN


=head1 SYNOPSIS

	use Doubly::Linked::PP;

	my $list = Doubly->new();

	$list->bulk_add(1..100000);

	$list->data; # 1;

	$list->length; # 100000;

	$list = $list->end;

	$list->data; # 100000;

	$list->prev->data; # 99999;

=head1 BENCHMARK

	use Benchmark qw(:all :hireswallclock);
	use lib '.';
	use Doubly::Linked::PP;
	use Doubly::Linked;
	use Doubly;
	my $r = timethese(2000000, {
		'Doubly::Linked::PP' => sub {
			my $linked = Doubly::Linked::PP->new(123);
			$linked->bulk_add(0..10);
			$linked = $linked->end;
			$linked->is_end;
			$linked = $linked->start;
			$linked->is_start;
			$linked->add(789);
		},
		'Doubly::Linked' => sub {
			my $linked = Doubly::Linked->new(123);
			$linked->bulk_add(0..10);
			$linked = $linked->end;
			$linked->is_end;
			$linked = $linked->start;
			$linked->is_start;
			$linked->add(789);
		},
		'Doubly' => sub {
			my $linked = Doubly->new(123);
			$linked->bulk_add(0..10);
			$linked = $linked->end;
			$linked->is_end;
			$linked = $linked->start;
			$linked->is_start;
			$linked->add(789);
		}
	});

	cmpthese $r;

----

	Benchmark: timing 2000000 iterations of Doubly, Doubly::Linked, Doubly::Linked::PP...
	    Doubly: 1.70335 wallclock secs ( 1.62 usr +  0.08 sys =  1.70 CPU) @ 1176470.59/s (n=2000000)
	Doubly::Linked: 7.49174 wallclock secs ( 7.04 usr +  0.44 sys =  7.48 CPU) @ 267379.68/s (n=2000000)
	Doubly::Linked::PP: 26.0622 wallclock secs (25.32 usr +  0.56 sys = 25.88 CPU) @ 77279.75/s (n=2000000)
				Rate Doubly::Linked::PP  Doubly::Linked           Doubly
	Doubly::Linked::PP   77280/s                 --            -71%             -93%
	Doubly::Linked      267380/s               246%              --             -77%
	Doubly             1176471/s              1422%            340%               --

=head2 SEE ALSO

L<Doubly>

L<Doubly::Linked>

=head1 AUTHOR

LNATION, C<< <email at lnation.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-doubly-linked-pp at rt.cpan.org>, or through
the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Doubly-Linked-PP>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Doubly::Linked::PP

You can also look for information at:

=over 4

=item * RT: CPAN's request tracker (report bugs here)

L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Doubly-Linked-PP>

=item * Search CPAN

L<https://metacpan.org/release/Doubly-Linked-PP>

=back

=head1 ACKNOWLEDGEMENTS

=head1 LICENSE AND COPYRIGHT

This software is Copyright (c) 2025 by LNATION.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

=cut

1; # End of Doubly::Linked::PP



( run in 0.598 second using v1.01-cache-2.11-cpan-71847e10f99 )