* the benchmark makes many runs and takes the MINIMUM time. This is calling for random. Additionally this way memory waste of a serializer is hidden. It might cause a GC with each run, but get lucky on one single run with an unrepresentative score.
--
You received this message because you are subscribed to the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-serialization-be...@googlegroups.com.
To post to this group, send email to java-serializat...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-serialization-benchmarking.
For more options, visit https://groups.google.com/d/optout.
Nate,I agree that without running each benchmark in separate, GC is problematic as you might get the garbage of a previous benchmark. But that's not the case now. Additionally warmup is increased, so JIT'ing is not part of measurement.Its not only GC its also L1 cache hits. Randomly e.g. Object.identityHashCode might happen to hit a single cacheline in an open hashmap without collisions. This can easily speed up like 10-15%, but it will happen only 1 out of 10000 times.I already tested with averaging and its not like everything is upside down. The order of the speed chart is pretty much the same with some minor nanoshifts here and there (one of them in the right place of course ;-)) ). But its now much more reproducable and realistic.Why would you want to average on 25% best runs ?
I had a look in VisualVM and the relevant (I did not check all ofc) Serializers do not run into FullGC, only minor GC (NewGen), so its pretty deterministic as long each test has its own VM. If a serializer allocates more memory than others, it will take a small hit in results (<5%), which reflects real behaviour in production closer than taking a percentage of best runs.Regarding Heap size: As no FullGC is involved, heap size does not matter, what matters is NewGen size. The VM makes a best guess for NewGen size depending on MaxHeap size and applies some runtime heuristics. We could hard set NewGen size using VM options, if you prefer we can also increase Heap size, it won't make that much of a difference. With small NewGen, you'll get more frequent NewGen GC's of short duration. With large NewGen you'll get fewer, but those few will take longer (which in turn makes results more indeterministic if you do *not* average).I think some of your bad gut regarding this is mostly caused by historical VM behaviour. With isolated tests and modern VM's the effects of newgen GC on the results are not that hard. As allocation hits L1 locality a lot, the good serializers are those having low allocation rate anyway, in other words memory hogs are slower even when factoring out GC :-).
I'll put in a switch to determine measurement method (Min,Avg), so we can defer the decision. Note that determining the best 25% would require to record all result values temporary ..
Am Sonntag, 9. März 2014 22:50:36 UTC+1 schrieb Nate:On Sun, Mar 9, 2014 at 9:52 PM, Rüdiger Möller <moru...@gmail.com> wrote:GC and memory usage can be affected by the rest of an app and the environment the app runs in. The more we measure that is likely to vary in the real environments these libs will actually be used, the less useful the results are. If we can control the effects (eg separate VMs, large heap) and results are relatively on par with what they were before, I'm ok with it.
Nate,I agree that without running each benchmark in separate, GC is problematic as you might get the garbage of a previous benchmark. But that's not the case now. Additionally warmup is increased, so JIT'ing is not part of measurement.Its not only GC its also L1 cache hits. Randomly e.g. Object.identityHashCode might happen to hit a single cacheline in an open hashmap without collisions. This can easily speed up like 10-15%, but it will happen only 1 out of 10000 times.I already tested with averaging and its not like everything is upside down. The order of the speed chart is pretty much the same with some minor nanoshifts here and there (one of them in the right place of course ;-)) ). But its now much more reproducable and realistic.Why would you want to average on 25% best runs ?
Using some percentage of the results would be to avoid skewing the results with runs that aren't actually representative, for whatever reasons. There are probably more things that could negatively affect a run than could make it "lucky". Maybe we could toss both the best and worst x%.
-Nate
On Sun, Mar 9, 2014 at 1:15 PM, Nate <nathan...@gmail.com> wrote:
On Sun, Mar 9, 2014 at 8:51 PM, Rüdiger Möller <moru...@gmail.com> wrote:
* the benchmark makes many runs and takes the MINIMUM time. This is calling for random. Additionally this way memory waste of a serializer is hidden. It might cause a GC with each run, but get lucky on one single run with an unrepresentative score.Memory usage and GC are complex enough it's probably better to try not to include their effects in the results. Taking only the fastest run might not be best, but including the slowest runs in the average is probably worse. Maybe we should average the fastest 25% or so of runs?
I am torn here: for the longest time, I have been advocate of including some of GC overhead in, because in real usage it is a significant component. But I also realize that the relative importance varies a lot based on both amount of serialization being done (is it a major component or minor), and heap size / general memory pressure.
I think that use of percentiles would make sense, and that although I do realize why minimums were chosen (it allows filtering out much of white noise), it is probably not the way to go.Perhaps simple median would work?
-+ Tatu +-
-Nate
--
You received this message because you are subscribed to the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-serialization-benchmarking+unsubscribe@googlegroups.com.
To post to this group, send email to java-serialization-benchm...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-serialization-benchmarking/quSX2VLU_zY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-serialization-be...@googlegroups.com.
To post to this group, send email to java-serializat...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to java-serialization-be...@googlegroups.com.
To post to this group, send email to java-serializat...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-serialization-benchmarking/quSX2VLU_zY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-serialization-be...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-serialization-benchmarking/quSX2VLU_zY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-serialization-be...@googlegroups.com.
GitHub provides free static HTML hosting for every project. If you commit to the "gh-pages" branch of a project, it'll show up at http://username.github.io/reponame
If you can get the info dumped into an HTML file, I'll try and see what I can do from there. In particular we need the benchmark results for each serializer, along with the properties of each serializer.
-Nate
To post to this group, send email to java-serialization-benchmarking...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-serialization-benchmarking.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-serialization-benchmarking+unsubscribe@googlegroups.com.
To post to this group, send email to java-serialization-benchm...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-serialization-benchmarking.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-serialization-benchmarking/quSX2VLU_zY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-serialization-benchmarking+unsubscribe@googlegroups.com.
To post to this group, send email to java-serialization-benchm...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-serialization-benchmarking.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-serialization-benchmarking+unsubscribe@googlegroups.com.
To post to this group, send email to java-serialization-benchm...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-serialization-benchmarking.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "java-serialization-benchmarking" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-serialization-benchmarking/quSX2VLU_zY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-serialization-benchmarking+unsubscribe@googlegroups.com.
To post to this group, send email to java-serialization-benchm...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-serialization-benchmarking.
For more options, visit https://groups.google.com/d/optout.
Yeah, I also thought about a dynamic query system .. but this would be quite some effort. Additionally you might need a hosting site.Another chart lib would be interesting .. currently I can only add 18 bars to the chart, then it starts failing.What's also an issue is lack of descripion. I always wonder what exactly the difference between all those protostuff and smile/* jackson/* flavours is ..
On Tue, Mar 11, 2014 at 6:10 AM, Rüdiger Möller <moru...@gmail.com> wrote:
Yeah, I also thought about a dynamic query system .. but this would be quite some effort. Additionally you might need a hosting site.Another chart lib would be interesting .. currently I can only add 18 bars to the chart, then it starts failing.What's also an issue is lack of descripion. I always wonder what exactly the difference between all those protostuff and smile/* jackson/* flavours is ..Jackson and Protostuff provide multiple formats/codec (the latter leverages the former for some of its formats).
Protostuff's runtime means reflection. Jackson's databind means reflection.Jackson's afterburner means runtime bytecode generation.
Btw, the manual variants need to go (we have too many frameworks/variants already).The libraries are most likely not gonna be used manually ... outside of their authors maybe.
Also, if we're gonna take memory/GC into account ... note that some of the libraries explicitly re-use their components while others do not.For example in this benchmark, Protostuff has a distinct advantage over Protobuf because the former re-uses its buffer, while the latter creates one every iteration.Another example is JBossMarshalling, it creates a specific input/output for the purposes of this benchmark in order to re-use components/buffers to avoid slowdowns from gc. I don't blame the author that did this (I could have easily done the same) because he is simply trying to level the playing field.
and "smile" is a binary data format (of 'binary json' genre).
Protostuff's runtime means reflection. Jackson's databind means reflection.Jackson's afterburner means runtime bytecode generation.
One simple thing to change here, wrt naming, would be start with data format name, not library name.This would be an opportunity to unify naming as well. We could replace 'databind' / 'runtime' with 'auto' (or automatic). Not sure if distinction between reflection and code generation is necessary to include in name, or just as a sidenote.
Btw, the manual variants need to go (we have too many frameworks/variants already).The libraries are most likely not gonna be used manually ... outside of their authors maybe.I was about to say that it's fine to leave them out from standard results, but I find some (ones for libs I work on) useful for sanity checking.
Others may occasionally find these useful perhaps -- if one wants XML output (f.ex), manual variant for streaming API does yield significant savings, and ability to measure amount of benefit can be useful.
Another example is JBossMarshalling, it creates a specific input/output for the purposes of this benchmark in order to re-use components/buffers to avoid slowdowns from gc. I don't blame the author that did this (I could have easily done the same) because he is simply trying to level the playing field.
That last one I am not sure about -- it is ok if such usage would be reasonable for actual usage outside of benchmark. But I don't like benchmark-only optimization, so I hope this is just something an advanced user would do for her use case.