spf4j icon indicating copy to clipboard operation
spf4j copied to clipboard

Improved Implementation of LifoThreadPool.

Open zolyfarkas opened this issue 9 years ago • 0 comments

Java FJP is a heavily optimized Thread Pool implementation which outperforms the legacy JDK thread pool and spf4j Lifo threadpool as shown by the beckmarks I have recently added to SPF4J:

Benchmark                                   Mode  Cnt     Score      Error  Units
ThreadPoolBenchmark.spfLifoTpBenchmark     thrpt   10  3322.753 ±  196.490  ops/s
ThreadPoolBenchmarkFjp.fjpBenchmark        thrpt   10  9679.502 ± 1160.887  ops/s
ThreadPoolBenchmarkStdJdk.stdJdkBenchmark  thrpt   10  3466.997 ±   81.594  ops/s

FJP uses Lifo thread scheduling just like spf4j pool, which made me think, yay! I can drop the spf4j implementation... But by looking into the implementation, I noticed that the pool is not as tweak-able as the spf4j pool is... which is quite important for certain use cases...

Additionally relatively serious issues with it have been fixed in FJP recently:

http://bugs.java.com/view_bug.do?bug_id=8078490

These fixes are not available for JDK 1.7 without paying for support.

Since spf4j is all about reliability and performance, I think the spf4j lifo threadpool next iteration will be a implementation based on a fork of the JDK FJP.

The performance of FJP is very promising, and will provide a significant boost to ZEL and the rest of the library and apps based on spf4j...

zolyfarkas avatar Sep 13 '15 15:09 zolyfarkas