Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Use sanitize.js script #267

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

camillobruni
Copy link
Contributor

@camillobruni camillobruni commented Jul 3, 2023

Make sure all workloads run with the same removed APIs

@camillobruni
Copy link
Contributor Author

Before:

browser                               Google Chrome          Safari                   Firefox
version                               114.0.5735.198         16.5.1 (18615.2.9.11.7)  114.0.2
os                                    macos 13.4.1 arm64     macos 13.4.1 arm64       macos 13.4.1 arm64
device                                MacBookPro18,2         MacBookPro18,2           MacBookPro18,2
cpu                                   Apple M1 Max 10 cores  Apple M1 Max 10 cores    Apple M1 Max 10 cores
Charts-chartjs/total                  73.3 ± 3.0%            116.6 ± 1.3%             112.3 ± 0.99%
Charts-observable-plot/total          53.7 ± 2.7%            58.98 ± 0.86%            64.99 ± 1.4%
Editor-CodeMirror/total               25.50 ± 1.3%           37.69 ± 1.0%             29.02 ± 3.0%
Editor-TipTap/total                   101.04 ± 0.53%         638 ± 2.9%               117.1 ± 6.5%
NewsSite-Next/total                   90.0 ± 1.6%            147.80 ± 0.58%           101.52 ± 0.46%
NewsSite-Nuxt/total                   73.2 ± 2.7%            146.86 ± 0.14%           97.7 ± 1.7%
Perf-Dashboard/total                  39.49 ± 1.8%           56.49 ± 1.3%             124.86 ± 0.47%
React-Stockcharts-SVG/total           80.0 ± 1.6%            105.1 ± 1.8%             100.3 ± 2.0%
TodoMVC-Angular/total                 32.07 ± 1.3%           44.22 ± 1.8%             53.22 ± 0.66%
TodoMVC-Backbone/total                26.22 ± 1.1%           34.81 ± 2.4%             36.94 ± 0.89%
TodoMVC-JavaScript-ES5/total          60.80 ± 0.85%          43.92 ± 0.96%            57.14 ± 0.95%
TodoMVC-JavaScript-ES6-Webpack/total  41.74 ± 1.2%           38.76 ± 0.78%            44.39 ± 0.49%
TodoMVC-JavaScript-ES6/total          45.63 ± 1.3%           45.40 ± 1.3%             49.37 ± 1.2%
TodoMVC-Preact/total                  10.67 ± 1.9%           15.43 ± 1.1%             14.094 ± 0.40%
TodoMVC-React-Complex-DOM/total       45.4 ± 3.2%            116.2 ± 1.6%             55.20 ± 0.22%
TodoMVC-React-Redux/total             38.69 ± 1.4%           44.88 ± 1.1%             52.66 ± 1.6%
TodoMVC-React/total                   32.63 ± 0.59%          39.10 ± 0.72%            46.96 ± 1.4%
TodoMVC-Svelte/total                  10.04 ± 1.3%           12.393 ± 0.32%           13.89 ± 2.0%
TodoMVC-Vue/total                     22.057 ± 0.41%         28.95 ± 2.8%             34.81 ± 1.4%
TodoMVC-jQuery/total                  90.0 ± 1.9%            90.49 ± 0.48%            89.83 ± 0.34%
Score                                 28.80 ± 0.56%          20.350 ± 0.42%           21.835 ± 0.29%

After:

browser                               Google Chrome          Safari                   Firefox
version                               114.0.5735.198         16.5.1 (18615.2.9.11.7)  114.0.2
os                                    macos 13.4.1 arm64     macos 13.4.1 arm64       macos 13.4.1 arm64
device                                MacBookPro18,2         MacBookPro18,2           MacBookPro18,2
cpu                                   Apple M1 Max 10 cores  Apple M1 Max 10 cores    Apple M1 Max 10 cores
Charts-chartjs/total                  71.9 ± 2.7%            112.4 ± 3.5%             112.42 ± 0.21%
Charts-observable-plot/total          51.78 ± 0.58%          59.82 ± 0.68%            65.09 ± 0.76%
Editor-CodeMirror/total               27.56 ± 2.6%           38.09 ± 0.70%            29.5 ± 3.9%
Editor-TipTap/total                   98.97 ± 0.49%          755.5 ± 0.16%            113.7 ± 1.8%
NewsSite-Next/total                   89.9 ± 2.7%            148.2 ± 1.7%             102.1 ± 1.3%
NewsSite-Nuxt/total                   72.11 ± 1.3%           147.56 ± 0.30%           99.5 ± 1.2%
Perf-Dashboard/total                  39.4 ± 2.6%            56.27 ± 0.75%            125.7 ± 1.1%
React-Stockcharts-SVG/total           78.12 ± 0.69%          108.30 ± 0.67%           102.34 ± 0.94%
TodoMVC-Angular/total                 31.66 ± 1.7%           44.74 ± 1.5%             53.58 ± 1.4%
TodoMVC-Backbone/total                26.05 ± 1.2%           35.23 ± 2.0%             37.38 ± 0.98%
TodoMVC-JavaScript-ES5/total          61.79 ± 1.1%           43.51 ± 1.9%             58.71 ± 1.0%
TodoMVC-JavaScript-ES6-Webpack/total  43.0 ± 2.4%            39.25 ± 1.2%             44.19 ± 0.94%
TodoMVC-JavaScript-ES6/total          46.0 ± 2.8%            44.63 ± 0.63%            49.32 ± 0.69%
TodoMVC-Preact/total                  10.61 ± 2.2%           15.50 ± 2.7%             14.09 ± 2.2%
TodoMVC-React-Complex-DOM/total       45.1 ± 3.4%            115.06 ± 0.74%           56.03 ± 0.61%
TodoMVC-React-Redux/total             38.66 ± 1.9%           45.15 ± 1.1%             52.76 ± 1.5%
TodoMVC-React/total                   32.25 ± 0.39%          38.87 ± 0.33%            47.25 ± 0.99%
TodoMVC-Svelte/total                  9.86 ± 1.9%            11.94 ± 2.9%             13.49 ± 1.5%
TodoMVC-Vue/total                     22.01 ± 1.3%           29.17 ± 0.93%            35.15 ± 1.0%
TodoMVC-jQuery/total                  89.5 ± 2.3%            90.5 ± 1.4%              90.6 ± 1.2%
Score                                 28.87 ± 0.44%          20.183 ± 0.17%           21.74 ± 0.54%

window.requestAnimationFrame = (cb) => window.setTimeout(cb, 0);
window.cancelAnimationFrame = window.clearTimeout;
const setTimeout = window.setTimeout;
window.setTimeout = function (handler, timeout) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this code needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was since we have to do it in some benchmarks we can apply it globally and not run the risk of potentially skipping work.

setTimeout(handler, 0);
};

window.requestIdleCallback = function (callback) {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should set it to undefined so that fallback patch will work in each workload instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, I fixed that already locally. 👍

Copy link
Member

@rniwa rniwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be making semantics changes at the same time refactoring the code.

@camillobruni camillobruni marked this pull request as draft July 4, 2023 08:18
@camillobruni camillobruni changed the title WIP Add sanitize.js script WIP Use sanitize.js script Nov 24, 2023
@camillobruni camillobruni added the non-trivial change A change that affects benchmark results label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-trivial change A change that affects benchmark results v3.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants