aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/misc/hipe_segment_trees.erl
AgeCommit message (Collapse)Author
2016-11-23Correct copyright on remaining hipe filesRichard Carlsson
2016-07-11hipe: segment tree delete operationMagnus Lång
Profiling showed that hipe_sdi spent most of its time in updateParents, discarding nodes that were already deleted. By introducing a delete operation to the segment trees, we can pay this cost only once, when deleting the node from the graph. Instead of keeping the ranges around, we recompute the range of the node when we delete it, since this can be done in constant time, without any memory allocation. Although segment trees are not designed to be modified once built, implementing a delete operation turned out to be a simple matter of repeating insertion, but deleting the index from, instead of consing it on, the appropriate nodes' values (segment lists). This optimisation drastically sped up hipe_sdi to the point of no longer being the bottleneck in the Assembly stage.
2016-07-11hipe_sdi: Use segment trees to represent PARENTSMagnus Lång
This speeds up parentsOfChild/2 from O(n) to O(lg n + k). A new module misc/hipe_segment_trees.erl is introduced.