3 ms·
Do any of the common browsers have an option to pin javascript to a dedicated CPU core?
by kees99 6y ago
Do any of the common browsers have an option to pin javascript to a dedicated CPU core?
- airocker 6y agoI believe you can write a program to do so: http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html http://man7.org/linux/man-pages/man2/sched_setaffinity.2.htm... Just manually figure out all(or the chosen ones) thread ids spawned by the chrome process.
- kevingadd 6y agoSadly that wouldn't help much since lots of important stuff happens on the same thread(s) that run JS. You also have the issue of javascript from website 1 trying to steal data from website 2, in that case pinning them both to your JS core wouldn't actually protect you from the attack. Among other things there are now mechanisms for doing page rasterization (PaintWorklet) and sound synthesis (AudioWorklet) in JS, so the overhead involved in making all your JS share a single core becomes more dramatic. There's also lots of stuff out there that uses Shared Workers and Workers to do background computation and that won't be background anymore if you pin them all to your JS core.
- kzrdude 6y agoSounds like that will require a 3-year effort to rewrite the javascript engine in that case.