Re:What a one line change did to the Chrome sandbox
by xiphias2 on Thursday April 23, 2020 @05:58AM
(#22954340)
Webassembly looks like an upcoming standard for sandboxing efficient code on the server side as well. As it's well supported and it doesn't have a big startup runtime cost, it looks like it has a real chance of success right now (after many failed ones in the last 25 years).
Re:What a one line change did to the Chrome sandbox
by londons_explore on Thursday April 23, 2020 @06:53AM
(#22954595)
Webassembly has a substantial performance hit for code containing hand-written vector loops using specialized instructions.
Things like video encoders and decoders are much slower in webassembly.
Re:What a one line change did to the Chrome sandbox
by xiphias2 on Thursday April 23, 2020 @07:05AM
(#22954670)
SIMD support is being worked on as far as I know, and this is a problem where there is room for a lot of improvement in the future. Generally interfacing between programming languages and systems efficiently, without too much data conversion/memory management is a harder problem than adding more low level programming support.
Re:What a one line change did to the Chrome sandbox
by snazz on Thursday April 23, 2020 @08:34AM
(#22955241)
Yes, it looks like WASM SIMD has already shipped in V8. There are some impressive demos on this page: https://v8.dev/features/simd
Re:What a one line change did to the Chrome sandbox
by londons_explore on Thursday April 23, 2020 @09:54AM
(#22955984)
It's kinda lame that none of those demos even run at 60fps, let alone 120fps on mobile for a real smooth experience, with lots of performance headroom for more than a single feature at once...
Re:What a one line change did to the Chrome sandbox
by throwaway483284 on Thursday April 23, 2020 @07:58AM
(#22955001)
I don't think SIMD support will help here, a lot of encoder/decoder code base is hand written ASM.
Re:What a one line change did to the Chrome sandbox
by roblabla on Thursday April 23, 2020 @08:27AM
(#22955192)
There's no reason to think it won't help - the encoder/decoder code base could be written in WASM directly to ensure it uses the SIMD instructions, and those will hopefully map closely to the machine SIMD instructions.
Of course though, you're right that it'll still incur a performance penalty.
Re:What a one line change did to the Chrome sandbox
by londons_explore on Thursday April 23, 2020 @10:43AM
(#22956554)
Someone needs to make a dev environment where someone can write WASM and see realtime the generated assembly instructions, together with the number of cycles to execute.
That way, the developer can tweak the input to the compiler to get exactly the sequence of instructions they wanted.
They can also hand write the output assembly, and put a patch in to the compiler saying "this generated assembly is faster that what you generated, so please generate this in the next version".
Re:What a one line change did to the Chrome sandbox
by tomrod on Thursday April 23, 2020 @08:46AM
(#22955324)
Sounds like a good margin to focus on for a... Patent? What would IP in the spade be?
Re:What a one line change did to the Chrome sandbox
by AgentME on Thursday April 23, 2020 @05:25PM
(#22961644)
Wouldn't patenting a performance optimization just work to prevent all browsers from adopting it?
Re:What a one line change did to the Chrome sandbox
by AnIdiotOnTheNet on Thursday April 23, 2020 @09:38AM
(#22955817)
Personally I find that hard to believe until it gets some mechanism of actually being able to free memory back to the OS.
Re:What a one line change did to the Chrome sandbox
by jfkebwjsbx on Thursday April 23, 2020 @04:18PM
(#22960749)
Wasm is too slow, and it is not different from other techniques that compile to an IR.
It does not stop all kinds of issues, so it is not secure on its own either.
Re:What a one line change did to the Chrome sandbox
by signal11 on Thursday April 23, 2020 @10:06AM
(#22956108)
Could "fast" VMs be a solution? e.g. Firecracker. You get a fairly robust level of isolation that way and they're quick to start.
Re:What a one line change did to the Chrome sandbox
by CJefferson on Thursday April 23, 2020 @03:23PM
(#22960027)
VMs feel a bit heavy, even if they are fast. If i want to wrap multiple parts of a program I could end up spawning a dozen VMs...
Re:What a one line change did to the Chrome sandbox
by PudgePacket on Thursday April 23, 2020 @06:29AM
(#22954487)
Not sure how relevant it is but Deno will be sandboxed by default (no disk/net access). So you could pipe in video and it could pipe out the encoded/decoded version with no access to disk.
This type of stuff is of course in browsers, and they are doing great work in this area, it is just a shame it is hard for the rest of us to use.