Closed Bug 1134800 Opened 9 years ago Closed 9 years ago

mozpack.path.match doesn't properly cache patterns

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(1 file)

We have a regular expression cache in mozpack.path.match. Unfortunately it isn't being used properly and the cache is never getting hit. This is resulting in some performance issues with the work in bug 1132111.
The regular expression cache for mozpack.path.match was keyed off the
original pattern. However, that variable was mutated as part of the
function and the mutated result was subsequently stored as the cache
key. This effectively resulted in a 0% cache hit rate.

On some tests being written for bug 1132111 which involve a full
filesystem traversal for moz.build files and subsequent execution of
those files, the following timings are indicative of the impact of this
patch.

Before:
real 16.082s
user 14.760s
sys   1.318s

After:
real 6.345s
user 5.085s
sys  1.257s
Attachment #8566729 - Flags: review?(mh+mozilla)
Attachment #8566729 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/671693d4fcf4
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: