in reply to Perl Data Structures
The main problem with coding things like trees in Perl, is not (so much), performance, but memory usage.
In C, a simple RB-tree node might require 20 (64-bit:40) bytes of ram. Doing the same in terms of Perl's built-in data structures will consume anything from 336 to 512 bytes. (64-bit Perl).
That order of magnitude increase in memory usage severally limits the size of tree you can deal with, even before you get to the performance aspect.
And anything you do to lessen the memory usage is a further direct hit on performance.
|
|---|