#πŸ”¬-selective-profiler

πŸ“¦ : https://github.com/needle-tools/selective-profiling Deep profile individual methods, filter profiling results, place UI markers in the profiler view.

marwi123

Ah well it's probably not the last time I need to force some repaints on things so πŸ€·β€β™‚οΈ πŸ˜„

neonage

Now that you mentioned repainting - I'm extremely stupid. The file size varied in size because of my reparenting script, sorry πŸ˜“

marwi123

Im not sure if we can do much here right now. It looks similar for me. And what is shown here is the name of the sample marker. Currently we require a relatively fully qualified name containing the assembly etc. Without it it would require a lot of guesswork and loading types/assemblies. There is still a possibility that we can get some more useful information from the profiler api which is what I'm hoping for

marwi123

In this case it matches. But for SceneHierarchyWindow I can't find the name, my guess is it exists in native land? Maybe we can still find those types by bruteforce but I'm just a bit worried if that would be stable enough and work reliably enough + increase performance cost when searching

hybridherbst

Can we do a preprocessing pass to find those maybe? I'll ping the profiler guys if there's, like, a list of them

marwi123

Btw getting callstacks when it's actually enabled in the profiler - which makes sense. So I think I can add at least some more menu items after a little refactor πŸ™‚

marwi123

<@!268763728952950785> just merged a new version into the main branch. If you enable callstacks now you get a lot more methods to profile. But be careful with deep profiling settings. It can easily get to profile hundreds of methods when e.g. deep profiling is set to 5 and enabling it for 15 methods.

neonage

Also, <@!272528485732450305>, I'm currently refactoring my Smart Hierarchy to use Harmony, so it's a little harder to profile. Would you like to test on it? πŸ™‚

frilke

I hope I'll find time soon to check the new stuff out again, but I've been a bit swamped lately

marwi123

Testing with visualizing some profiler data in hierarchy and inspector. I'd would ideally also like to click on it the relevant items in the profiler but that doesnt really work very well yet regarding selecting the items in the treeview (as you can see in the video...). There would be minor things to be fixed (like inspector collapsing) but those are very doable

marwi123

Started adding Graph-Labels for special markers you can define (e.g. if you want to highlight UI interaction or special events in your game)

hybridherbst

This is a git repository. The Needle Profiler isn't uploaded to any registry yet, it's early preview

hybridherbst

Ah, right. We have to remove that - there was a dependency to OpenUPM but there isn't anymore.

marwi123

We had a dependency on harmony, which is gone on the latest remove-editorpatching-dependency branch

hybridherbst

Please clone the repo, switch to the remove-editorpatching-dependency branch and then reference it via manifest.

frilke

Great to see this being released publicly!

Though when I tried adding the package to our project, we get the following compiler issues:

The type 'TypeDefinition' exists in both 'Mono.Cecil, Version=0.10.0.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e' and 'Unity.Burst.Cecil, Version=0.10.0.0, Culture=neutral, PublicKeyToken=fc15b93552389f74' error CS0433: Assets\Source\Mimimi.Core.Extensions\CodeBaseVisualization\ClassDependencyData.cs(103,56)

The class in question was previously already using Mono.Cecil;, but it seems Unity does a sneaky and includes a Mono.Cecil namespace in their Unity.Burst.Cecil library. Any ideas how to fix this?

hybridherbst

πŸ‘€ we'll take a look - the usual solution is that we need to properly prefix assemblies and make all dependencies explicit.

marwi123

<@93804453479579648> try 1.0.1-pre if you like, I removed the cecil dependency which was pulled in but not actually needed anyways so it should work with burst now (tested in 2020.3.33f1 and burst 1.6.6)

peterkcodes_

hi there, I'm looking into using this awesome package for better profile my mesh gen algorithm, how well does it handle threading?

marwi123

Profiling is still handled by unity, the package injects profiler sample marker for you into the code that you can dynamically add/remove via the profiler hierarchy so is the result is the same as if you would add the markers in your code permanently