in reply to Re^2: efficient perl code to count, rank
in thread efficient perl code to count, rank
Databases use structures like B-trees for indexing and sorting and are pretty good in balancing these trees between RAM and disk. °
They optimize the trade-off between memory and time.
Perl is pretty bad in sorting linear stuff which is part in RAM and part on disk.
(Well you could tie an AoA to a file representing a table. Sorting that array would go without much RAM but mean constant overhead with each access. This is certainly worth a shot, but as I said DBs have this already optimized.)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) from WP B-tree
Unlike other self-balancing binary search trees, the B-tree is well suited for storage systems that read and write relatively large blocks of data, such as disks ...
... for the purpose of efficiently managing index pages for large random access files. The basic assumption was that indexes would be so voluminous that only small chunks of the tree could fit in main memory.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: efficient perl code to count, rank (merge sort)
by LanX (Saint) on Jul 18, 2021 at 12:36 UTC |