Closed Bug 1838529 Opened 2 years ago Closed 2 years ago

Reserve space in the properties vector to avoid costly vector growth

Categories

(Core :: JavaScript Engine: JIT, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: mgaudet, Assigned: mgaudet)

References

Details

(Whiteboard: [sp3])

Attachments

(1 file)

See Bug 1836679, Comment #2 for motivation

On the microbenchmark from Bug 1836679:

$ hyperfine 'obj-with/dist/bin/js keys-benchmark.js' 'obj-without/dist/bin/js keys-benchmark.js'
Benchmark 1: obj-with/dist/bin/js keys-benchmark.js
Time (mean ± σ): 256.9 ms ± 2.2 ms [User: 257.9 ms, System: 8.9 ms]
Range (min … max): 254.3 ms … 262.5 ms 11 runs

Benchmark 2: obj-without/dist/bin/js keys-benchmark.js
Time (mean ± σ): 349.4 ms ± 1.0 ms [User: 351.0 ms, System: 10.0 ms]
Range (min … max): 347.6 ms … 350.9 ms 10 runs

Summary
'obj-with/dist/bin/js keys-benchmark.js' ran
1.36 ± 0.01 times faster than 'obj-without/dist/bin/js keys-benchmark.js'

Funny story: I can get almost the same performance here by just changing the template parameter on StackGCVector to have 16 elements rather than 8 -- I'm evalauting that change more holistically at the moment (mach try perf is submitting at the moment)

So, just for giggles I tried Speedometer 3 with a bigger StackVector inline size; no impact

Assignee: nobody → mgaudet
Status: NEW → ASSIGNED
Whiteboard: [sp3]
Attachment #9339180 - Attachment description: WIP: Bug 1838529 - Reserve space in the properties vector to avoid costly vector growth → Bug 1838529 - Reserve space in the properties vector to avoid costly vector growth r?jandem
Severity: -- → N/A
Priority: -- → P1
Pushed by mgaudet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d10510c76d9c Reserve space in the properties vector to avoid costly vector growth r=jandem
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: