Improve the performance of LBS->store() by 58%.
commit3924fe306de158025e6e33e4f5b2fc279cfd4620
authorMark Glines <mark@glines.org>
Sun, 27 Jul 2008 05:19:37 +0000 (26 22:19 -0700)
committerMark Glines <mark@glines.org>
Sun, 27 Jul 2008 05:19:37 +0000 (26 22:19 -0700)
treef3fba7dddb279ba9e6a8a2ba79b995cc3bc782a3
parentdc5bb6d9594ab8f1cd28da0d24d990ea7ada65b9
Improve the performance of LBS->store() by 58%.

Previously, it split the data into a tree of arrays, and then wrote
it in a recursing loop.  I've switched it to a flat array of
[location, value] pairs, which improved things nicely.

Previously:

perl -Iblib/lib bench.pl  13.60s user 0.02s system 99% cpu 13.680 total

Now:

perl -Iblib/lib bench.pl  5.61s user 0.02s system 98% cpu 5.709 total
lib/Language/Befunge/Storage.pm