Opened 8 years ago
Closed 7 years ago
#4454 closed defect (fixed)
Differentiate.differentiateExp speed is poor
Reported by: | Henning Kiel | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | 1.12.0 |
Component: | Backend | Version: | v1.12.0 |
Keywords: | Cc: | Adrian Pop, Martin Sjölund, Francesco Casella |
Description
The speed of Differentiate.differentiateExp() is poor due to recursion check.
if listMember(inExp, inExpStack) then Error.addInternalError("Differentiation failed due to recursion...
When removing the check the time of postOpt tearingSystem
goes down from 26s to 2s in ScalableTestSuite.Electrical.BreakerCircuits.ScaledExperiments.BreakerNetwork_N_640
Can this be improved, made optional or removed completely?
listMember()
uses valueEq()
which seems to be slow for this purpose.
Change History (5)
comment:1 by , 8 years ago
Cc: | added |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Cc: | added |
---|
Elements are not deleted.
I suggest removing the loop check completely. There is a max. iteration check, so this should catch the loops as well. Anyway, is it really possible, that a loop can happen (at this stage)?
I created PR1698 which removes the loop check completely.
comment:5 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The recursion check is removed completely as it is only a compiler-sanity-check.
PR1698
Are elements also deleted from the stack? If not, then it might be more efficient to use a hash set.