Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: RFC: Abusing "virtual" memory

by snowhare (Friar)
on Dec 09, 2007 at 03:37 UTC ( #655923=note: print w/replies, xml ) Need Help??


in reply to Re^4: RFC: Abusing "virtual" memory
in thread RFC: Abusing "virtual" memory

#!/usr/bin/perl use strict; use warnings; use BerkeleyDB; my $db_file = '/home/snowhare/perl_monks/example.db'; unlink $db_file; my $db = BerkeleyDB::Btree->new( -Filename => $db_file, -Cachesize => 700_000_000, -Flags => DB_CREATE, ); srand; for(my $count = 0; $count < 12_000_000; $count++) { my $random_value = rand(16776216); my $status = $db->db_put( "$random_value" => "$count" ); } undef $db; [snowhare@blue-bay perl_monks]$ time ./big_btree.pl real 3m47.121s user 3m7.978s sys 0m4.884s
This was on a desktop class machine with 1.5GBytes of RAM and an AMD Athlon 64 3000+ processor running Fedora Core 6 Linux.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655923]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2021-01-23 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?