Created
June 26, 2014 03:58
-
-
Save fujiwara/e53dba248668c60fb654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl s.pl | |
keys:10000 size:1348738 | |
keys:20000 size:2708562 | |
keys:30000 size:3478562 | |
keys:40000 size:5428210 | |
keys:50000 size:6198210 | |
keys:60000 size:6968210 | |
keys:70000 size:10097506 | |
keys:80000 size:10867506 | |
keys:90000 size:11637506 | |
keys:100000 size:12407507 | |
keys:110000 size:13187507 | |
keys:120000 size:13967507 | |
keys:130000 size:14747507 | |
keys:140000 size:20246099 | |
keys:150000 size:21026099 | |
keys:160000 size:21806099 | |
keys:170000 size:22586099 | |
keys:180000 size:23366099 | |
keys:190000 size:24146099 | |
keys:200000 size:24926099 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.12.1; | |
use B (); | |
use B::Size2 (); | |
my $bighash = {}; | |
for my $key ( 1 .. 200_000 ) { | |
$bighash->{$key} = "foo"; | |
if ( $key % 10000 == 0 ) { | |
say "keys:$key size:", B::svref_2object($bighash)->size; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment