You turned "FFlagMicroprofilerThreadSearch" off, but Left/Right Navigation Tooltip is shown

Description

If you press the keys CTRL + F, you get showing this tooltip right here.

image

I’ve been pressing ← (Left) and → (Right) cluelessly, trying to focus in and out of the text box, pressing those arrow keys, with no success.

It didn’t make sense to me. The data that contain the names for those markers are there when you Export as CSV. Everything looks to be there, why won’t this work? Why am I unable to navigate through the search results of this CTRL + F “find” feature.

I even went here to put my confusion: https://devforum.roblox.com/t/introducing-microprofiler-memory-profiling-flame-graphs-diffs-and-much-more/3226910/42

So, I felt like that this tooltip is misleading me. But why would Roblox do that?
Originally, I wanted to type trolling, but I replaced the word with “misleading”

 

 

So, I wanted to figure out HOW I have to press the Left and Right Arrow keys, until I found the following shocking news…

if (FFlagMicroprofilerThreadSearch) {

	if (evt.keyCode === 39) {

		MoveToNext(1);

	}

	if (evt.keyCode === 37) {

		MoveToNext(-1);

	}

}

FFlagMicroprofilerThreadSearch is turned off, it is set to false, so I typed FFlagMicroprofilerThreadSearch = true in the Browser Console and I could move between the search results using the arrow keys. (I assume that it let’s me navigate through all possible results, right?)

 

As soon as I noticed this, I rushed to the Bug Report section, and now I am here. Because, there is 100% a mistake here, without a doubt.

Why is the “Left/Right keys = navigate” tooltip shown, if the Fast Flag for it is turned off?

 

Re-production Steps

  • Open up Studio
  • Create a sample script that you can catch off with the MicroProfiler
Example

game.StarterPlayer.StarterPlayerScripts

Name the LocalScript Test123 Script or something.

local SpawnLocation = game.Workspace:WaitForChild("SpawnLocation")

while true do
	--debug.profilebegin("Test123")
	
	local newColor = Color3.new(math.random(), math.random(), math.random())
	SpawnLocation.Color = newColor
	
	--debug.profileend("Test123")
	
	task.wait(1)
end
  • Start the game and when you see the SpawnLocation change its color, do CTRL + F6, or whatever hotkey is needed to open up the MicroProfiler (because Studio STILL has hotkeys wrong on some keyboard layouts), then Dump the MicroProfiler, e.g. dump a decent amount of frames so you have a couple of MicroProfiler stuff ready.
  • Go to your %LocalAppData%/Roblox/logs and open the most recent created .html MicroProfiler dump.
  • Press CTRL + F to open the “find” feature.
  • If you, for instance, named your script Test123 type “Script_Test” into the Textbox located below the Label that says “Timer/Thread”
  • If you hit enter, you get brought to the search result which’s computation time took the longest out of all.
  • You may notice that the tooltip says “Left/Right keys = navigate”
  • Click the Left and Right keys on your keyboard.
  • Observe, how nothing happens.
  • Open the browser console and type FFlagMicroprofilerThreadSearch = true and hit enter.
  • Try to click the Left and Right keys on your keyboard now.
  • Observe, how something does happen now.

 

Expected Result

Due to the fact that there’s a tooltip telling me, that I can use Left and Right keys to navigate, I expect Left and Right keys to do something. But they didn’t do anything.

Actual Result

I get shown this tooltip

image

But nothing happens when I press ← (Left) and → (Right). Not until I turn on FFlagMicroprofilerThreadSearch.

The entry point that hints to Left and Right click feature for the find function is shown to me, even though the thing that gates it, is set to false FFlagMicroprofilerThreadSearch.

2 Likes

Hi HealthyKarl! Thanks for the detailed bug report. I’m actually the one who introduced the FFlagMicroprofilerThreadSearch flag and you’re right that this is not intended. In addition to searching, the arrow keys also should work any time a scope is highlighted (such as when moused over). I immediately knew this was weird because I thought I addressed this exact thing…

As you point out, the call to MoveToNext is hidden behind a flag:

function KeyDown(evt) {
	if (FFlagMicroprofilerThreadSearch) {
		if (evt.keyCode === 39) {
			MoveToNext(1);
		}
		if (evt.keyCode === 37) {
			MoveToNext(-1);
		}
	}
	...
}

But that’s only because it was moved from KeyUp to KeyDown. When the flag is not set, it’s supposed to still work in KeyUp:

function KeyUp(evt) {
	if (!FFlagMicroprofilerThreadSearch) {
		if (evt.keyCode == 39) {
			MoveToNext(1);
		}
		if (evt.keyCode == 37) {
			MoveToNext(-1);
		}
	}
	...
}

They’re called with the same parameters, so why doesn’t it work with the flag off? Well…

function MoveToNext(direction) {
	//1 forward, -1 backwards
	if (FFlagMicroprofilerThreadSearch) {
		...
		direction = direction > 0 ? 1 : -1;
		...
	} else { // fast flag off, old behavior
		...
		var Forward = Direction && Direction < 0 ? 0 : 1;
		...
	}
}

…while rewriting MoveToNext, I uncapitalized the Direction variable, causing an error if you take the old code path. Whoops! Unfortunately, we have a code freeze to prevent incidents over the holidays. That’s in place until early January so I can’t give a proper fix for now.

A workaround is to download this rofiler.js.txt (301.0 KB). The .js.txt extension is only because you can’t attach .js files here, so you must rename the file to remove the .txt part. To do this from the Windows file viewer, you may need to enable View > Show > File name extensions. When you open a dump, you can override the broken behavior (when flag is off) by adding it to the URL bar like this:

file:///C:/Users/USERNAME/AppData/Local/Roblox/logs/broken-microprofile-dump.html#www=file:///C:/PATH/TO/NEW/DOWNLOADED/rofiler.js

Or, since the flag adds some nice functionality, you can use this instead force-flag-on-rofiler.js.txt (301.1 KB). Sorry for the confusion, and I hope this helps! I’ll get this working as it should as soon as possible after the New Year. :slight_smile:

4 Likes

I didn’t expect the MicroProfiler to have all these hidden abilities, with #www= and apparently there’s one that is #local. Very interesting, thanks!