spark

spark

26M Downloads

Disable timings / don't run with timings

PaulBGD opened this issue ยท 3 comments

commented

Often on Spigot based servers I see sparks that are very misleading due to timings being collected at the same time. I think it'd be smart to find a way to either disable the timings when spark is samping, or simply choosing not to run because of it.

commented

Timings running at the time time shouldn't result in misleading results..

You might see timings calls show up in the profile, but that's just because well, recording+calculating timings has a performance cost too.

commented

Timings makes the percentages inaccurate, because of how they work. Methods that are ran more frequently, like mob ticking, run the timings code more often causing those methods to inaccurately have a higher % than they should. Methods with timings that run less often look more performant than they are compared to methods with timings that run more.

commented

That sounds.. reasonable.

The way spark works (a simple overview) is:

  • at a certain interval (say 4ms)
    • it asks the VM for each thread being sampled, "hey what method are you executing"
    • it adds the time (e.g. 4ms) to the method total

The viewer then just shows this in a tree and calculates the percentages.

Of course, this isn't totally accurate, it's an average, but over a sufficiently long sampling period it becomes accurate enough to be useful.

spark doesn't "count" how many times a method is invoked, only how often the method was executing when the sample was taken. Timings methods aren't treated specially - if they are showing up with high numbers in your profile, then that just means timings is having a high performance impact.