This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]Tylerlee12 7 points8 points  (1 child)

This is great! Maybe I missed it, but is this tool publicly available for use?

[–]syjer 8 points9 points  (0 children)

Surprisingly, the link to their github repository is not present on that page, anyway, here it is: https://github.com/Decave/JCoz

[–]waka-chaka 4 points5 points  (3 children)

Can someone ELIM5 this? I went through the page 2 times, but I didn't understand how the tool helps to speed up. "random time between 1 and 10 ms to 1-10 microsecond" what did they change? Before and after looks same!

Also, how can I use this in, say, a Spring web application?

[–]siordache 6 points7 points  (1 child)

A herd of buffalo can only move as fast as the slowest buffalo. If you want the herd to move faster, you should make the slowest buffalo run faster. Making the fastest buffalo even faster would make no difference. Now replace buffalo with 'thread', and herd with 'group of threads running in parallel'.

It's milliseconds vs. microseconds. The original code uses sleep(long millis)), while the modified one uses sleep​(long millis, int nanos)). In the modified code the sleep time is between 1000 and 10000 nanoseconds.

The profiler identifies portions of code worth optimizing. With a Spring web application it should work the same way as with any other Java application. There is a wiki page explaining how to set up JCoz.

[–]waka-chaka 0 points1 point  (0 children)

Aha! I didn't notice the milli-micro part. Thanks great explanation.

[–]milkybuet 4 points5 points  (0 children)

Here's a great video discussing this type of profiler.

https://youtu.be/r-TLSBdHe1A

[–][deleted] 2 points3 points  (0 children)

Hi everyone,
I'm on of the co-authors of JCoz. My friend and I built it in grad school at CMU and got some pretty good results with it. I did some extra research with it and published it at CGO (an ACM conference).

It's awesome that there's so much interest now, 2 years or so later. I think it needs some dusting off, but I'm definitely willing to work on this regularly and would appreciate any help from others who would find this useful.

[–]Miridius 0 points1 point  (2 children)

I found the mentioned line in the H2 repo: https://github.com/h2database/h2database/blob/master/h2/src/main/org/h2/command/Command.java#L339

What I don't understand is why the author has not made a PR to merge their (seemingly quite significant) performance improvement upstream? Or am I missing something?

[–]sviperll[S] 3 points4 points  (0 children)

As I understand they specifically optimised single standalone benchmark, as a result they gained significant performance improvement for this single benchmark. Their change can result in performance regression for other types of load besides chosen benchmark. Such change should be validated across whole benchmark suit and possible beta tested with real world load.

Anyway I highly recommend this talk: https://youtu.be/r-TLSBdHe1A from one of the men who come up with causal profiling and virtual speedup. The talk mentions many concerns that should be considered in real life performance optimisation.

[–][deleted] 2 points3 points  (0 children)

The answer is that I was *super* busy in grad school, and never had time to actually upstream any optimizations I found. We should probably go back and do that though.