#! perl -slw use strict; use List::Util qw[ first reduce ]; use Math::Random::MT qw[ rand ]; use Benchmark::Timer; use Algorithm::BLT; $| = 1; our $MAX ||= 1000000; my( $new, $exists ) = (0) x 2; my $seen = Algorithm::BLT::new( convert => 'd', key => 'x4 a2', tail => 'a4 x2 a2' ); my $T = new Benchmark::Timer; $T->start( 'test' ); for( 1 .. $MAX ) { my $n = int( rand 1_000_000_000_000 ); $seen->( $n ) ? $exists++ : $new++; printf "\r%10d : %10d", $exists, $new unless $_ %1000; } print $/; $T->stop( 'test' ); $T->report; printf 'Record mem. usage? '; ; __END__ P:\test>346619 -MAX=30000000 104190 : 29895810 1 trial of test (1,252s total) Record mem. usage? 215,412 KB