IonMonkey: Optimize findBestFreeRegister

RESOLVED FIXED

Status

()

RESOLVED FIXED
7 years ago
4 years ago

People

(Reporter: jandem, Assigned: sunfish)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [ion:t] )

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
audio-beat-detection spends about 15% of the time under allocateRegisters, most of it in findBestFreeRegister. findBestFreeRegister has a number of inefficiencies, for instance if we need a GP register we shouldn't look at intervals for double registers, and if the interval has a register hint, and this register is free, there's no need to look at the other registers.

With some refactoring findBestFreeRegister should be both faster and easier to understand.
Whiteboard: [ion:t]
(Assignee)

Comment 1

5 years ago
Created attachment 770633 [details] [diff] [review]
a proposed fix

This patch implements the first part of your suggestion; avoiding looking at GP regs when double regs are needed and so on. It results in about a 3% reduction in the total number of instructions executed on a bunch of common benchmarks when run with --ion-eager.
Attachment #770633 - Flags: review?(jdemooij)
(Reporter)

Comment 2

5 years ago
Comment on attachment 770633 [details] [diff] [review]
a proposed fix

Review of attachment 770633 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thanks for doing this.
Attachment #770633 - Flags: review?(jdemooij) → review+

Comment 4

5 years ago
Will there be a part 2?  If so, please put "leave open" in the whiteboard.
(Assignee)

Updated

5 years ago
Whiteboard: [ion:t] → [ion:t] [leave open]
(Assignee)

Comment 5

5 years ago
Thanks; added. Part 2 would be using hints when present to speed up findBestFreeRegister, though I'm not currently working on it.
(Reporter)

Comment 7

4 years ago
LSRA is now disabled by default (and will be removed soon) so we can close this. sunfish did land a patch here so marking this FIXED.
Assignee: jdemooij → sunfish
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Whiteboard: [ion:t] [leave open] → [ion:t]
You need to log in before you can comment on or make changes to this bug.