496
HTML5 accelerator card
(lemmy.nz)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Tbf, it's not really like processors have 'DO JS STUFF' instructions, they are not made for one language or data format specifically of course. But ultimately, instructions are shaped by things people use.
JSON for example requires searching strings for structural characters:
,,{,}etc. Iirc you can use VPSHUFB ('Packed Shuffle Bytes' or so, AVX >=2) to map 32 bytes (or 64 on AVX-512 I guess) to any structural character in one instruction. That's quite the speedup compared to comparing all of them to all special characters one at a time, even considering SIMD kinda moves on its own pace. And it's exactly the kind of stuff you would use in your JS engine to make parsing JSON crazy fast, even when it's plain text, which is obviously less than ideal for a computer.I remember there was some instruction that was introduced specifically because of something JS does all the time tought. I forgot what it was, maybe someone else can help out.