Closed
Bug 1523746
Opened 7 years ago
Closed 7 years ago
Content Blocker uses and caches many NSRegularExpression objects
Categories
(Firefox for iOS :: Data Storage, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: robert.m.pieta, Unassigned)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Steps to reproduce:
Profile Firefox in Instruments.
Actual results:
25%+ of memory usage on startup (persisting through the usage of the app, though the % changes are memory is allocated) is related to NSRegularExpressions. Tracing this down, thousands of regular expressions are allocated by the content blocker.
Expected results:
Although NSRegularExpression is a reasonable choice, there is a more performant option using String.range(of: pattern, options: .regularExpression) that doesn't require expensive allocations.
| Reporter | ||
Comment 1•7 years ago
|
||
Attachment #9039905 -
Flags: review?(gkeeley)
Attachment #9039905 -
Flags: review?(gkeeley) → review+
Great stuff! Landed on master
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•