Earlier quoted context omitted.
There doesn't have to be a choice between a fast ISA, and even 64 bit registers, and using 32 bit pointers/indices. We can do theoretically do both - it's just extremely rare in practice.
Not rare at all. 32-bit "pointers" in a 64-bit process is relatively common, even, as it's what ART does on Android ( https://www.anandtech.com/show/8231/a-closer-look-at-android... ). And Hotspot has a similar optimization: https://wiki.openjdk.java.net/display/HotSpot/CompressedOops
Up to 4GB of Memory in WebAssembly
61–70 of 86 posts
Re: Up to 4GB of Memory in WebAssembly
#62Earlier quoted context omitted.
> Doubling the size of every index, integer, etc comes at significant memory cost for next to no benefit. The overwhelming majority of GUI program data is composed of images, textures, sounds, videos, 3D models, text, etc. I would bet that less than 5% of the memory required to host a popular web page (facebook, amazon, etc.) is dedicated to pointers, array indices, etc.
You would lose your money, because most of that is not needed in RAM, and definitely not in cache.
Re: Up to 4GB of Memory in WebAssembly
#63Earlier quoted context omitted.
I assume it's from when you used to boot DOS mode games that addressed beyond 640KB conventional memory they had DOS/4GW labeled all over. https://en.wikipedia.org/wiki/DOS/4G
The slash helps. I'm pretty sure Duke Nukem, Doom, and similar all showed that banner during startup.
Re: Up to 4GB of Memory in WebAssembly
#64Earlier quoted context omitted.
The overwhelming majority of what wasm will be used for probably does not include images, textures, sounds, videos or 3d models. The overwhelming majority of the memory in most wasm programs will probably be not large arrays of text. The webpage as a whole is a gui program, but wasm is primarily a place to run computationally intensive code. The web-browser deals with things like rendering images natively without sto…
What do you think that computationally expensive code is cranking on? It ain't small bits of text.
Re: Up to 4GB of Memory in WebAssembly
#65Earlier quoted context omitted.
The overwhelming majority of what wasm will be used for probably does not include images, textures, sounds, videos or 3d models. The overwhelming majority of the memory in most wasm programs will probably be not large arrays of text. The webpage as a whole is a gui program, but wasm is primarily a place to run computationally intensive code. The web-browser deals with things like rendering images natively without sto…
Honestly, I don't like the trend of web apps for everything, and I'd be ok if web pages couldn't really be more than toy programs. However, at that point, why even bother with WASM? I mean what is that even for if you're not doing real computation on real data sets? Real data sets are bigger than 2 billion sometimes...
As for "what is the point if not doing computation on "real" data sets"... letting you do computation on reasonably sized data sets. Consider that the size of a gaint codebase like linux is still only a few hundred megabytes (uncompressed). That's more than enough data to be doing interesting work. Or look at the size of a game like quake3.
Re: Up to 4GB of Memory in WebAssembly
#66Earlier quoted context omitted.
Honestly, I don't like the trend of web apps for everything, and I'd be ok if web pages couldn't really be more than toy programs. However, at that point, why even bother with WASM? I mean what is that even for if you're not doing real computation on real data sets? Real data sets are bigger than 2 billion sometimes...
If you've got 2GB of data and you're doing it in WASM... you're probably doing something wrong, for the simple reason that that means you probably loaded 2GB of data over the internet into the browser (and will probably need to redo that every time you revisit the page). That's enough data that you want to save it to disk, which means (probably) not using a browser. As for "what is the point if not doing computation…
No, web pages can access local storage.
Re: Up to 4GB of Memory in WebAssembly
#67Earlier quoted context omitted.
If you've got 2GB of data and you're doing it in WASM... you're probably doing something wrong, for the simple reason that that means you probably loaded 2GB of data over the internet into the browser (and will probably need to redo that every time you revisit the page). That's enough data that you want to save it to disk, which means (probably) not using a browser. As for "what is the point if not doing computation…
> for the simple reason that that means you probably loaded 2GB of data over the internet No, web pages can access local storage.
(Can't say I'm terribly up to date on the different ways to store data as a website... but if there's a way to persist multiple gb I would be very surprised)
Re: Up to 4GB of Memory in WebAssembly
#68Earlier quoted context omitted.
Why prefer 64bit pointers over multiple memory address spaces ( https://github.com/WebAssembly/multi-memory )? Your CPU has to do a lot of work to keep pretending it's memory is flat, If we give up that pretense you can optimize cache utilization and multiplex multiple WASM threads onto a single OS thread without allowing specter.
Because the CPU is going to do the work to make that illusion happen regardless of if you participate in it or not - so why constrain yourself to anything less than 64-bit pointers if you're not going to get anything in return? What cache optimization are you referring to? Just that 32-bit pointers is a form of pseudo-compression and can be more densely packed? Because there's not really any other cache benefits in p…
V8 sandboxes WASM by placing them in a dedicated OS process, this buys 64 bit pointers, but comes at a cost. We can chose for a 64 bit processor to buy us in process memory isolation, by masking pointers or we can have 64 bit pointers.
Re: Up to 4GB of Memory in WebAssembly
#69Earlier quoted context omitted.
As is mentioned in the article, u64 was used to future proof for wasm's upcoming memory64 type: https://github.com/WebAssembly/memory64/blob/master/proposal...
Yeah, so what are they going to do when they then claim to need to to represent the length 2^64?