Opened 13 years ago
Last modified 13 years ago
#1576 closed defect (fixed)
BackendDAEUtil: Improve speed of BinTree
Reported by: | Martin Sjölund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Martin Sjölund, Adrian Pop, 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 by , 13 years ago
comment:2 by , 13 years ago
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:5 by , 13 years ago
Seems to be working as profiling says it now uses 0.25% total time, down from 8.5%.
comment:6 by , 13 years ago
Maybe we should do the same with HashTables, now that we can really make them generic.
comment:8 by , 13 years ago
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 by , 13 years ago
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)...