Opened 13 years ago
Last modified 13 years ago
#1576 closed defect (fixed)
BackendDAEUtil: Improve speed of BinTree
Reported by: | sjoelund.se | Owned by: | sjoelund.se |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | sjoelund.se, adrpo, Frenkel TUD |
Description
The current binary tree calls printComponentRefStr for *each* level of the tree, which is quite deep for the V6 engine (8% of total checkModel time is spent on bintree get operations).
How to solve this? Store the cref and its hash in the tree. Only make a string comparison if the hashes match. Or is someone already working on an alternative bintree, Adrian?
Change History (9)
comment:1 Changed 13 years ago by sjoelund.se
comment:2 Changed 13 years ago by adrpo
No, i'm not working on this.
You can maybe improve the AvlTree.mo if you want and then
we could use it everywhere.
comment:3 Changed 13 years ago by sjoelund.se
Does that file even work with the bootstrapped compiler?
comment:4 Changed 13 years ago by adrpo
No idea, I haven't check, but I suppose it should.
comment:5 Changed 13 years ago by sjoelund.se
Seems to be working as profiling says it now uses 0.25% total time, down from 8.5%.
comment:6 Changed 13 years ago by adrpo
Maybe we should do the same with HashTables, now that we can really make them generic.
comment:7 Changed 13 years ago by sjoelund.se
HashTables already use hashes for comparison :)
comment:8 Changed 13 years ago by adrpo
Sorry, I now seen your commit, I thought you improved and used the AvlTree.mo and suggested to
also make the hashtables more generic. Btw, why don't we use AvlTree instead of the BinTree?
comment:9 Changed 13 years ago by sjoelund.se
For the same reason we have the old (pre-generic) hashtables still in use. The code is there and it's annoying to update it :)
It seems VarTransform also uses this (or similar, but even slower)...