@giltene any interest in getting this optimization ported to the Java implementation? (jonhoo/hdrsample#33) I don't know how much of a priority deserialization performance is, but presumably some analysis workloads deserialize a lot
@marshallpierce not near my computer atm, but a few comments about your PR: can you reference the tracking issue for const functions in the comment? Shouldn't :1037 also be ORIGINAL_MAX? And :1047 ORIGINAL_MIN? Saturating add sounds like a good idea. update_histogram should probably consume self. Test for RestatState? Otherwise looks good.
@jonhoo I debated whether or not to use constants there and wasn't really convinced either way, so if it felt weird to you to not use them, then they probably should be used. :) I couldn't think of anything meaningful to test about RestatState that wasn't already covered by the deserialization and subtraction tests. Open to new tests if you can think of any.