Skip to content

Added an easy way to add sub steps to the profiler - #1067

Merged
stephengold merged 3 commits into
jMonkeyEngine:masterfrom
Jeddic:master
Apr 22, 2019
Merged

Added an easy way to add sub steps to the profiler#1067
stephengold merged 3 commits into
jMonkeyEngine:masterfrom
Jeddic:master

Conversation

@Jeddic

@Jeddic Jeddic commented Apr 10, 2019

Copy link
Copy Markdown
Contributor

This is the implementation I use in spoxel to dig into performance within app states. The default profiler only gives timings for the App State Manager, but this code automatically profiles each of the app states added to the App State Manager. You can set further breakpoints within the update methods of an app state by calling:

profiler.appSubStep("EffectState", "Run Client Effects");

In this case "EffectState" is an app state and "Run Client Effects" is one of the profiling points i've set.

…pp State Manager to profile the update method of each app state
@pspeed42

Copy link
Copy Markdown
Contributor

Neat. The path manipulation weirded me out at first but then I noticed the whole class is smelly in that regard. So good job navigating that!

For the record: my notes on the smelliness that have nothing to do with this patch:

  1. A stateful "path" field that seems to only be used as a temporary string builder... probably should have been called tempPath to make that clearer.
  2. many cases where locally scoped variables "path" collide with that name causing confusion.
  3. the getPath() is called all over the place and routinely creates new StringBuilders all the time... making me question the value of the temp path string builder.

@Jeddic

Jeddic commented Apr 10, 2019

Copy link
Copy Markdown
Contributor Author

Yea, the whole path implementation was a little weird but it works for how simple the profiler is. It worked for me with spoxel and really helped narrow down some of the performance problems I had hidden in my code. I added a missing file change to the commit.

@stephengold
stephengold merged commit 0bc060d into jMonkeyEngine:master Apr 22, 2019
@stephengold stephengold added this to the v3.3.0 milestone Jul 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants