Le 22 oct. 2014 à 16:24, Joaquin M Lopez Munoz
Akim Demaille
writes: Hi Joaquin!
Le 14 oct. 2014 à 11:34, Joaquin M Lopez Munoz
a écrit : Hashing and equality comparison of flyweight'd expressions is going to be blazingly fast as compared with recursive non-flyweight'd versions.
Yes, that's where I expect to get most of my speed up. However, for deep expressions, ordered containers were quite fast, more than hashes, since often the comparison does not go deep inside. So I'll have to bench whether to stick to ordered containers, or move to unordered ones.
I'm not sure I'm following you here... Comparison and hashing of flyweights is blazingly fast *and* does not depend on the expression depth of the flyweight'd values --it does not depend on the values at all, in fact.
Yes, of course. I was referring (with the "were", I agree it's subtle :) to the pre-Flyweight implementation. I was commenting that I was surprised that in general ordered structures were faster that unordered ones, and I suspect it's mostly because hashing is always deep, and comparison is not. However, I don't like Flyweight address comparison. Sure, it's fast. It also not well defined, not repeatable, not portable etc. At least when developing, I like having something more stable, so I will probably stick with a deep comparison. So I was saying that moving to flyweights also means, in my case, looking for places where unordered is ok, and move to unordered in these places.