Microbenchmarking Mono's new GC
gonzalo.name
gonzalo.name
the benchmark was run once: we have no idea if this was a fluke or not. hopefully the author didn't repeat and pick the best.
at best the numbers reported can be considered some mean. the mean is not a robust estimator: http://en.wikipedia.org/wiki/Robust_statistics#Examples_of_r...
one sample is enough to distort the mean. furthmore we've no idea how typical this run was: there should be some measure of spread.
http://zedshaw.com/essays/programmer_stats.html
I think we've seen that already. Mean is "good enough" for most programmers apparently. And to be honest in many cases, it's ok. It was a microbenchmark, not a big evaluation of latency of both algorithms.
spikes happen in performance (for better and for worse) all the time. one spike is enough to totally distort the mean, no matter how often you repeat.
it might be a microbenchmark but to paraphrase: if it's not done well, it's not worth doing. the complete opposite of what the microbenchmark purports to show could be true most of the time.
Then again - let's say I'm a user of some library and I trust the developers to do the right thing and test the new implementation against the old one. The thing that is of interest to me is whether on average on my random test I still see the difference. He did. Sure - the whole test is flawed, may be incorrect, etc. In reality - he just verified something he already knew/expected against his random data. No matter how much we care about correctness, he's still right on some level. There's a visible improvement even on this random test and if he tried it at least 3 times we can assume that the new GC is worth looking at if you had issues with the previous one.
"if it's not done well, it's not worth doing"? I'd say - if it answers your question, it's worth doing. If you assume the question was - "can I verify that the new GC is better in my random not-scientific test on a specific dataset", then everything's all right.
And I do hope that the person writing the new GC will publish some better stats.
2. the article didn't repeat anything, at all. it's not even on average (at least, as it's reported). as far as i can tell, he ran a test once and reported the result.
3. the point is that judging from one sample or a mean on a small sample does not answer any reasonable question because the (unrepresented) uncertainty in the answer could actually mean the result goes either way in general.
btw, what i'm suggesting isn't some deep, complicated statistics! i'm suggesting the most basic, elementary statistics. this is super, super basic stuff. high school kids here know about the mean and standard deviation here.
if you want to be more principled about things kind of thing, you could either do some kind of hypothesis test (e.g., a two-sample t-test adjusting for variance would be appropriate here) or use a Bayes factor to compare the two hypothese (better, not better).
That said, I would like to see a benchmark that uses a bit more memory, not just temporary stuff to be discarded ASAP. Many of the Java promotion benchmarks do that too (focus on use of transient data only). What happens if you actually need to hold on to some state, rather than merely concatenating somebody's account info into a dynamic index.html page in a web app?
Oh well, there's always memcached, I suppose. It would be nice to have languages that support app types other than stateless-as-possible web apps.
Main reason why copying and generational GCs are not used everywhere is that they tend to generally complicate matters when you want to seamlessly interface with C code (non-managed code in .NET terms), because objects then tend to be moved around by GC, which has to see and be able to update every reference to it's heap.
In most applications and runtimes, there are a lot more behind the stages objects allocated by VM and or library routines than objects that you allocate directly in your code.
Edit: and I think that Sun's JVM uses generational GC at least since 1.3, if not 1.2.
> Mostly precise scanning (stacks and registers are scanned conservatively).
Why would you code a conservative garbage collector for .NET?
Edit: also you can implement conservative scan of stack and registers on Unix without writing single line of assembly code by scanning result of getcontext(), or even almost completely portably by scanning result of setjmp() + some heuristics for finding stack in memory.
And especially in case of .NET which offers pretty tight integration with unmanaged code, you can have various stack frames with layout completely out of your control on stack (I'm not sure whenever such stack frames must be scanned for pointers, but they will certainly complicate any attempts to analyze stack structure).
It has certainly been done in various Java implementations. HotSpot I'm pretty sure does precise garbage collection.
Native stacks don't need to be scanned for pointers, but the VM must of course keep track of which parts of the stack are native.
But those few objects referenced directly may keep a lot of other stuff alive. It's not that uncommon to have left-over pointers on the stack that are no longer live, but still reference a large graph of objects.
Edit: you can do stop-the-world GC at any point of program whan you scan stack conservatively, GC-safe points are only needed for precise scanning of stack and registers, so this is problem only when you want to be fully precise. Fully precise GC is certainly better when it is possible, but conservative scan works mostly well enough.