RFR: CODETOOLS-7903486: JMH: Revisit available jmh.executor options
Sergey Kuksenko
skuksenko at openjdk.org
Fri Jun 2 19:39:44 UTC 2023
On Fri, 2 Jun 2023 11:32:45 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> We currently have a few executor options in JMH. As [CODETOOLS-7903476](https://bugs.openjdk.org/browse/CODETOOLS-7903476) shows, not all of them are ready to be used.
>
> GitHub hits:
> "jmh.executor=CACHED_TPE", 0 hits
> "jmh.executor=FIXED_TPE", 0 hits
> "jmh.executor=VIRTUAL_TPE", 0 hits
> "jmh.executor=FJP", 3 hits (various forks of jsoniter)
> "jmh.executor=FJP_COMMON", 0 hits
> "jmh.executor=CUSTOM", 99 hits (various projects)
>
> Looks like CACHED_TPE and FJP_COMMON can go away.
> Others are renamed to capture their major characteristic.
>
> Some light bikeshedding about the names is welcome.
I agree. Using FJP_COMMON is dangerous, it's system-wide thread pool and its usage may give unpredictable behavior.
Also, I agree that CACHED is useless.
The current pair PLATFORM (was FIXED_TPE) and VIRTUAL and fine, I just realized that it makes sense to note in a comment that both executors provide threads that live through the whole benchmark execution. (Especially that comment will be useful for VIRTUAL).
Now I am thinking if expanding the set of PLATFORM/VIRTUAL executors may be useful.
I am thinking about another pair platform/virtual when "Executors.newThreadPerTaskExecutor" is used. The pair will provide executors when every JMH iteration will use clean new threads.
-------------
PR Comment: https://git.openjdk.org/jmh/pull/108#issuecomment-1574221875
More information about the jmh-dev
mailing list