Conversation
|
I now enforced Considering our heavy use of functors, maybe flambda would help a lot, especially if one level of functor can make such a difference. |
This is very slow because every add/remove in a fold-loop relifts.
|
I now tried hashconsing instead of my Well, it may be the answer if we didn't use the Another idea might be to combine the two approaches to get some kind of lazy hashconsing, which would only hashcons maps that |
|
This has been sitting in the sidelines for now, but I think I'll have to see how this affects the newer heavy privatizations. I suppose they still can keep quite big CPAs around. My biggest worry with this PR, is that the stricter interfacing of |


In the traces branch, some new privatization implementations (mutex-oplus, mine, mine-nothread) keep a copy of everything in the local domain. Timing shows that this causes an unreasonable amount of time spent on
equal,compareandhashofCPA, which are very naïve. We have physical equality and hashcons optimizations for the entireSpec, but this does nothing to improve the performance ofSetoperations in path-sensitivity, which I suspect is the culprit here.Right now I made two changes, which notably improved the performance of those privatization implementations on some large benchmarks:
equal.hash. I did this by storing a lazy hash computation with the map.Initially I thought using another hashcons more inside would leak a lot of memory by keeping lots of intermediate
CPAs in the hashcons hashtable, so I didn't go that route. I later looked intoBatHashconsand realized it usesWeakto avoid leaking memory that way, so it might be worth going that way after all.For now, this is just a draft PR on top of the traces branch, where it really matters. The current implementation is ugly and changes all of
MapDomainactually, not justCPA. A cleaner implementation would be to have the hash caching/hashconsing as aMapDomainfunctor to just apply it toCPA, but the leaky abstractions and lacking interfaces inMapDomainmake it difficult.