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 Martin Sjölund, 13 years ago

It seems VarTransform also uses this (or similar, but even slower)...

comment:2 by Adrian Pop, 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:3 by Martin Sjölund, 13 years ago

Does that file even work with the bootstrapped compiler?

comment:4 by Adrian Pop, 13 years ago

No idea, I haven't check, but I suppose it should.

comment:5 by Martin Sjölund, 13 years ago

Seems to be working as profiling says it now uses 0.25% total time, down from 8.5%.

comment:6 by Adrian Pop, 13 years ago

Maybe we should do the same with HashTables, now that we can really make them generic.

comment:7 by Martin Sjölund, 13 years ago

HashTables already use hashes for comparison :)

comment:8 by Adrian Pop, 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 Martin Sjölund, 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 :)

Note: See TracTickets for help on using tickets.