Closed Bug 1118040 Opened 5 years ago Closed 5 years ago

Remove getChar()'s maybeEOL optimization

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: sstangl, Assigned: sstangl)

Details

Attachments

(1 file)

getChar() uses an optimization to detect newlines by usually indexing each char16_t into a large array of bools. It turns out that compilers emit better code when you just do the naive thing.

This patch improves octane-code-load by 3% (~20200 -> ~20800). It also marginally improves load times of general large codebases, such as Shumway. It's also a very small memory improvement, since we don't need that table.

If this winds up emitting terrible code on a particular compiler, it can always be backed out easily.
Attachment #8544257 - Flags: review?(evilpies)
Attachment #8544257 - Flags: review?(evilpies) → review+
https://hg.mozilla.org/mozilla-central/rev/6299801edf7c
Assignee: nobody → sstangl
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
No regression on all the AWFY platforms.
maybeEOL was definitely a win when I added it, but I just measured Parsemark (bug 839450) with and without it, and the difference was negligible. Yay for simplification.
You need to log in before you can comment on or make changes to this bug.