lucko / spark

A performance profiler for Minecraft clients, servers, and proxies.

Home Page:https://spark.lucko.me/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support virtual threads

MartijnMuijsers opened this issue · comments

Description

It would be nice to be able to profile virtual threads in addition to platform threads.

Proposed Behaviour

Virtual threads would show up in addition to platform threads in the report.

Extra Details

Currently, the implementation to get thread info uses ThreadMXBean.dumpAllThreads, which does not support virtual threads.
However, virtual threads do support these methods when invoked directly upon them.
So therefore, I would suggest, instead of using the ThreadInfo instances, to use a custom ThreadInfo record that contains the information that we need, and pull it straight from the Thread instances.
That would be the change needed to make it compatible with virtual threads.