Closed Bug 1604914 Opened 5 years ago Closed 3 years ago

Make ShouldProfileThread more efficient

Categories

(Core :: Gecko Profiler, task, P3)

task

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: mozbugz, Assigned: cwinter158)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file)

ShouldProfileThread looks inefficient: It converts full strings into lower case each time before doing comparisons, this is wasteful when (probably) the comparison will stop short and not compare all characters.
This is not critical, as it's only called once per thread, but it would be nice to clean up.

Some options include:

  • Convert the filter string to lowercase once. (But we may want to keep a copy of the original for the UI.)
  • Use tolower in a comparison loop.

While here, we should make sure we have proper tests, including for the new "*" filter.

Hi, Gerald

I'm new to contributing to Mozilla and I would like to work on this as my first issue.

(In reply to ma18btech11011 from comment #1)

I'm new to contributing to Mozilla and I would like to work on this as my first issue.

Hello, and thank you for offering to help.
If you haven't done so already, please read (Contributing to the Mozilla code base){https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction}, there is quite a bit of work to get started, so please make sure you follow all the relevant steps.
The needed code change here is in C++ (we can use C++17 now), so start with building Firefox (Choose "2. Firefox for Desktop" during the "bootstrap" step).
Then try to fix this bug here, assign yourself to the bug, and submit your patch for review.

If you need help along the way, the easiest way to contact me is on https://chat.mozilla.org , I'm @gerald there. Or email me.

Good luck!

Hi Gerald, I'd like to work on this as my first contribution to Firefox, assuming this hasn't been fixed already.

(In reply to cwinter158 from comment #4)

Hi Gerald, I'd like to work on this as my first contribution to Firefox, assuming this hasn't been fixed already.

Hello cwinter158 and welcome to Firefox. 😄
Yes, this bug is still available. Please see my comments above for some help with how to start. All the best, and I'm here to help when you have questions.

When starting the profiler, also make a copy of the filter strings
converted to lower-case. This allows caseless comparisons to be made
against thread names without repeatedly converting the filters to
lower-case for each thread.

Assignee: nobody → cwinter158
Status: NEW → ASSIGNED
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f544eddd5fec Make ShouldProfileThread more efficient r=gerald
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: