So just a small improvement here.
with 10 mln iterations and 3 threads:
original: +total: wait= 3008, time=8736
with fix: +total: wait= 574, time=1604
Here lock-free implementation is 6 times faster.
I understand that this case is rather specific and test might be not very thorough, but IMHO lock on global resource just to retrieve String representation of enum isn't a right way to go and eventually might be bad for performance.
Would such improvement be considered for merging?
If yes - then I would need some advice on this because of following issues:
- When I tried to apply this fix on 2.11.x branch I've got false alarm about binary incompatibility because private Scala methods and fields after compilation end up as public methods in byte-code and compatibility check tool looks only at byte-code. I've described the case in comment of related issue https://issues.scala-lang.org/browse/SI-6882 and considered that it's better to target the improvement to 2.12
- But tests for freshly fetched branch 2.12.x didn't run on my machine, neither on jdk 7, nor on jdk 8 - just as described in https://issues.scala-lang.org/browse/SI-9077, all though Scala 2.12 is promised to run with Java 8 only (http://www.scala-lang.org/news/2.12-roadmap)
Which steps would you suggest to make further?
Thanks!