-
Notifications
You must be signed in to change notification settings - Fork 37
Zipper unselection benchmark #60
Comments
I think this is absolutely a good idea. I put some thought into this a while ago, but I didn't act on it because, frankly, it's such a mess to encode the equivalent operations in scala.xml or jaxp. :-S Also, I was a little afraid of what the performance would turn out to be. You're quite right that we should be measuring this empirically. |
If no one has started on this, I'll take a crack at it. I also want to get some measurements on some of the other Zipper methods ( |
I haven't started on it yet (haven't found the time). It's definitely an important item though; thanks for tackling it! |
The above pull request includes these benchmarks along with some optimizations. The new "modify" trials measure an entire select/modify/unselect cycle (or its equivalent). To run them, enter Just to give a flavor for some of the new trials, I'll discuss some of the deep-modify results. These trials find an element by name and add an attribute to it. The first deep-modify trial uses the same query as
As can be seen, anti-xml significantly outperforms the other implementations. This is primarily due to the bloom filter optimization, which gives anti-xml a huge advantage in this trial. A different extreme can be seen in the
The first item that jumps out is the awful jaxp performance. I haven't fully analyzed this, but it seems that updating nodes found via Notice also that
As can be seen, roughtly 2/3 of the Strangely, the To get an idea of what's possible, I tried writing a some modify algorithms in
My best time was 25ms, in the |
Followup - I actually found some optimizations that significantly reduce the overhead of the bloom filter. Indeed, they actually turn it into a net positive for the |
I'm going to try to find some time in the near future to create some new charts on the website based on the new benchmarks. This is really amazing stuff. I was hoping to get zipper to within an order of 5 worse than manual rebuilding. The idea that it could be faster than rebuilding with scala.xml just never occurred to me! |
:) Let me know if anything could use further explanation. Implementations like "anti-xml - no bloom" are mainly of internal interest, so I hacked it such that they don't show up at smaller run levels. If you run |
I think we should devise some target benchmark for zipper unselection (deep, shallow, or whatever).
Otherwise, uber horrible performance like the one before the fix in issue #55 may creep in without us noticing.
The text was updated successfully, but these errors were encountered: