MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.69k stars 1.34k forks source link

feat: add tracy profiler integration #5258

Open BenjaminAmos opened 5 months ago

BenjaminAmos commented 5 months ago

Contains

This pull request integrates Terasology's PerformanceMonitor with the Tracy Profiler. This allows for better visualising performance traces and should help with diagnosing performance bottlenecks.

image

How to test

Outstanding before merging

soloturn commented 4 months ago

i can not open https://github.com/BenjaminAmos/TracyJavaBindings

BenjaminAmos commented 4 months ago

https://github.com/BenjaminAmos/TracyJavaBindings should be public now. I was staging the library in a private repository and forgot to make it public before creating this pull request.

jdrueckert commented 4 months ago

So, I just tested this out and noticed the following: When hitting F4 in-game, the game crashed with an UnsatisfiedLinkError: Can't load library: /path/to/Terasology/natives/linux/tracy-jni.dll

What I did:

  1. groovyw lib get TracyJavaBindings
  2. in libs/TracyJavaBindings: chmod +x gradlew && git submodule update --init && ./gradlew jar
  3. Start Terasology and start a new game
  4. Press F4

Logs:

17:23:00.151 [main] ERROR o.t.engine.core.TerasologyEngine - Uncaught exception, attempting clean game shutdown
java.lang.UnsatisfiedLinkError: Can't load library: /home/jdr/Development/Git/Terasology-iota/natives/linux/tracy-jni.dll
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
    at java.base/java.lang.Runtime.load0(Runtime.java:755)
    at java.base/java.lang.System.load(System.java:1953)
    at io.github.benjaminamos.tracy.Tracy.<clinit>(Tracy.java:17)
    at org.terasology.engine.monitoring.impl.PerformanceMonitorImpl.<init>(PerformanceMonitorImpl.java:83)
BenjaminAmos commented 4 months ago

The library loading errors should be fixed by https://github.com/MovingBlocks/TracyJavaBindings/commit/fa7be512d59f0d500c4e5c0ef498c39f4ea73055.

soloturn commented 1 month ago

@BenjaminAmos can this one be merged or something is still open?

BenjaminAmos commented 1 month ago

As far as I know, the only thing left before this can be merged is building the TracyJavaBindings library and publishing it to artifactory. We need builds for Windows, macOS and Linux, with macOS being the one that is usually the hardest to achieve.