profiler icon indicating copy to clipboard operation
profiler copied to clipboard

We generate URLs that are too long for bit.ly in a profile with lots of threads

Open mstange opened this issue 7 years ago • 6 comments

Example profile

When I click the permalink button on this profile, bit.ly returns {"status_code":500,"status_txt":"INVALID_URI","data":[]}, which probably means that it thinks the URL is too long. The length is almost completely due to the globalTrackOrder parameter.

mstange avatar Nov 08 '18 21:11 mstange

Wow, this profile has so costly reflows (several seconds for me)!! Filed #1480 for this.

The length of this URL is 3195.

julienw avatar Nov 09 '18 10:11 julienw

I sent an email to [email protected] about this.

julienw avatar Nov 09 '18 10:11 julienw

For what it's worth, removing the track ordering feature would most likely fix this issue.

gregtatum avatar Nov 19 '18 21:11 gregtatum

Hmm, good point.

mstange avatar Nov 19 '18 21:11 mstange

Also, we have the uintArrayToString which we can use for better compression of the arrays of indexes. We are already using this for CallNodePaths.

gregtatum avatar May 14 '19 14:05 gregtatum

We use uintArrayToString now. The original example in this issue has gone down from 3213 bytes to 232 bytes.

But with lots of threads and processes, we still get really long URLs.

New example profile

About half the bytes go into hiddenLocalTracksByPid and the other half goes into localTrackOrderByPid.

I can think of two improvements:

  • To reduce the size of hiddenLocalTracksByPid, we could treat hidden processes specially and stop persisting their individual hidden threads in the URL: If a process is hidden, all of its threads are hidden. Re-showing the global track for the process would only show the main thread for that process and none of its other threads.
  • To reduce the size of localTrackOrderByPid, we could omit the thread order from the URL if the process's thread order is the default thread order.

mstange avatar Jun 10 '22 16:06 mstange