Bug 175663
| Summary: | [JSC] Proxy is slower in 10 times than defineProperty with function | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | GSkachkov <gskachkov> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ashvayka, saam, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
GSkachkov
Proxy is slower in 10 times than defineProperty with function, so I feel there is a space for improvements:
https://esbench.com/bench/5995518299634800a0348df3
Proxy
```
var p = new Proxy({}, {
get: function(target, prop, receiver) {
return 10;
}
});
var result = 0;
for (var i =0; i< 100000; i++){
result = result + p.a;
}
console.log(result);
```
```
var p = {};
Object.defineProperty(p, 'a', { get: function(x) { return 10; } });
var result = 0;
for (var i = 0; i< 100000; i++){
result = result + p.a;
}
console.log(result);
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
GSkachkov
I think we need to start from good benchmark tests, I'll check what part of the Proxy is covered by ES6 Benchmark test
GSkachkov
There is a small discussion on esdiscuss.org:
https://esdiscuss.org/topic/proxy-performance-jit-compilation
Alexey Shvayka
Performance of Proxy [[Get]] was significantly increased by https://commits.webkit.org/260282@main and a few follow-ups.
*** This bug has been marked as a duplicate of bug 252229 ***