Skip to content

Conversation

@Jeddic
Copy link
Contributor

@Jeddic Jeddic commented Apr 10, 2019

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
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
Copy link
Contributor Author

Jeddic commented Apr 10, 2019

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