Performance test for BZip2CompressorOutputStream#108
Performance test for BZip2CompressorOutputStream#108XenoAmess wants to merge 19 commits intoapache:masterfrom
Conversation
…nto should_we_add_break_here
and revert changes about BZip2CompressorOutputStream back to master
|
result: |
|
result json |
|
for new commers, the last conversation happened in #106 |
|
Hey @XenoAmess |
Indeed. |
|
No doubt the break won't make things worse. Sometimes it's more difficult to optimize projects writen by JAVA than ones writen by C. We can use SIMD/SSE and some other optimizations in C but not in JAVA, which is a common and pretty efficent way to optimize performance in projects with lot of computations, like compression. Seems the JIT can provide some optimizations in Runtime but it's controled by JVM itself. |
Yep, JIT seesm an amazing black box. |
@bodewig
So I tried to make a refine for
BZip2CompressorOutputStreamyesterday.for conclusion,
so we donot need to revert that change yesterday.
I mean, all of my refine tries seems no significant improvement for performance.
3.0 class
BZip2CompressorOutputStreamis the class in branch master now(with break). classBZip2CompressorOutputStreamNonBreakis the version without break.3.1. class
BZip2CompressorOutputStreamXenoAmessInShort: aims to useshortinstead ofbooleaninData.inUsearray, and use bit operations for copy/change.3.2. class
BZip2CompressorOutputStreamXenoAmessInBoolean: aims to inline more, and added some small changes.3.3 class
BZip2CompressorOutputStreamXenoAmessInBoolean2: aims to inline as LEAST methods as we can, and wholly trust JIT will give it a good C2.and the result of performance test shows that there are nearly no difference in speed actually, and
BZip2CompressorOutputStreamruns slightly (very slightly) faster than others.(which means all of my refinitions failed)But, as all known, jmh is actually not a stable thing, so as the diffenerce are really small, I think it is the right time for me to surrender and stop trying to refine it using my tricky ways.
And the
BZip2CompressorOutputStreamin master now is good. No need to revert thebreak. at least on win10, jdk13.Althought the refining-try failed, maybe the performance test codes and the "refined"(or, variant actually, as they does not refine anything) classes might be useful.
I just put them in the test folder, and maybe next time when some guy wanna refine this class, they can at least know in what ways I failed and stop waste time on it.