Closed takahiro0327 closed 9 months ago
After reviewing it, the key brackets were lame, so I changed them to columns.
How does aggregation affect the order column ? Is the order counted from the 1st instance or is it random?
Kind of random. To be precise, the order in which they are added to _data is the oldest.
The first value in the sequence of GroupBy return values is used. (group.First()) This is the first value found in a sequence of _data.Values in ProfilerInfo belonging to a group.
The order of Dictionary.Values used in KKS is the order in which they were added. So it will return the numeric value of the oldest instance in the group. If the scene was just loaded, you might expect this to be close to the smallest value in the group.
We can still read the rough order, but should we make it so that the smallest value in a group is displayed?
This is unrelated, but added re-sorting when changing options.
Fixed a problem that the data is not aggregated when _needResort flag is OFF. Fixed to make order values more stable.
I think the smallest value should be used for the order.
Is it this way? What difference does it make?
I just took a look at the source and the current Max implementation should be fine. I'll test it later and merge if all is good.
Sorry if you have already tested it. I noticed a bug and will fix it.
Bug fixed. Past values were included in the aggregate.
Tested the latest commit. There appears to be an issue where the list stops updating after enabling and then disabling Aggregation. It sometimes resumes updating after closing and reopening the profiler window, but then the list appears to be corrupted. Unhooking and then re-hooking fixes the issue.
Normal
After enabling aggregation
After disabling aggregation (list no longer updates)
After closing and reopening the profiler window (list should be exactly the same as in step 1 but the order values are different and sometimes it doesn't update)
Thanks for the review. Fixed. How about this.
It updates correctly now. The only issue left that I can see is the "Ran" column shows the right toggle as off
incorrectly when it should be on
.
It might be best to remove the right toggle in Aggregate mode since some methods might run and others might not. Maybe replace the column with "any ran". Alternatively 3-state checkboxes could be used I suppose, but I'm not sure if IMGUI supports that.
Sorry, I didn't think that far ahead.
Remove right toggle when in aggregate mode.
Separate aggregate from executed and non-executed. The toggle on the left should now be accurate.
Is the SinceLastRun type of byte an intentional specification? Sometimes there were moments when it overflowed and things that were not working seemed to be working. I changed the type to uint for now.
Thanks too for the review and the useful tool! This profiler helped me fix my code which was slow.
Aggregate button added. It aggregates ticks and gcbytes of the same function. Please merge if you like.
It was clear that DynamicBone was the slowest, but we wanted to be sure. I also wanted to make sure that there were not a large number of instances at the bottom of the list that would cause slowness.