Summary: | private class members are much, much slower than public members | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | scythes.corms_0i | ||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | NEW --- | ||||||
Severity: | Normal | CC: | dpaddock, jarred, mark.lam, rik, rob.palmer2, webkit-bug-importer, ysuzuki | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Safari 16 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
scythes.corms_0i
2023-06-29 02:02:58 PDT
I can replicate these numbers on my M1 Macbook Air using latest STP. The performance drop for native private fields is greater in JSC than V8. Safari TP #private fields: 35 ops/sec Safari TP public fields: 632 ops/sec Chome Canary #private fields: 62 ops/sec Chome Canary public fields: 107 ops/sec This is surprising. Created attachment 467196 [details]
microbenchmark that can be run from jsc shell
I've attached a microbenchmark that can be run from the jsc shell directly. ``` ❯ jsc -m out.js cpu: unknown runtime: unknown (unknown) benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------------------ ----------------------------- Polyfillprivate 81.76 ms/iter (79.48 ms … 84.84 ms) 82.04 ms 84.84 ms 84.84 ms NativePrivates 41.32 ms/iter (40.31 ms … 43.61 ms) 41.76 ms 43.61 ms 43.61 ms ConventionalPrivates 919.52 µs/iter (619.67 µs … 2.65 ms) 780.25 µs 1.95 ms 1.96 ms ``` |