Live data from Hacker News

Up to 4GB of Memory in WebAssembly

v8.dev

31–40 of 86 posts

Re: Up to 4GB of Memory in WebAssembly

#31
post #29

Earlier quoted context omitted.

I, on the other hand, wish everyone would embrace 32 bit by default. Doubling the size of every index, integer, etc comes at significant memory cost for next to no benefit. Increasing the amount of memory used directly impacts performance considering how slow memory is and how important it is to keep commonly used items in cache. If you're seriously using more than 4gb in a web page... I wouldn't mind a non-default w…

> 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.

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 storing the image in wasm.

Re: Up to 4GB of Memory in WebAssembly

#32
post #10

So, will we need to have 4GB of ram to run Javascripts now? :)

The title refers to web assembly memory limit. However, it’s mentioned javascript now supports up to 16 million terabytes of memory (equivalent to 4 jira tabs).

I must be tired, because the Jira stab went right over my head, twice! well done.

Re: Up to 4GB of Memory in WebAssembly

#33
post #31

Earlier 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.

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

#34
post #10

So, will we need to have 4GB of ram to run Javascripts now? :)

The title refers to web assembly memory limit. However, it’s mentioned javascript now supports up to 16 million terabytes of memory (equivalent to 4 jira tabs).

Hah! It really is comical how insanely slow and bloated JIRA is. Its the only tab I keep open 24/7 because loading it takes so long.

When I restart my PC I have a login script that fires up a bunch of slow stuff while I get coffee. My IDE's, Docker containers... and my JIRA tab :)

Re: Up to 4GB of Memory in WebAssembly

#35
post #10

So, will we need to have 4GB of ram to run Javascripts now? :)

Taken seriously: RAM often does get offloaded to disk as needed, so realistically this changes nothing in terms of specs needed to handle what's in memory. Taken less seriously: Do you not already need this just to run JIRA on Chrome? Or apps on Electron, generally?

I've found its faster and more reliable to reload JIRA tabs by simply creating a VM, running it on a browser in there, and pausing the VM when you don't need JIRA. When you need it, or after a restart, simply load up your VM and resume the operating system. This usually takes only a second or two, much faster than reloading JIRA the normal way.

If anyone from Atlassian is here, please help me create an official JIRA tab VM image! Maintaining my JIRA OS negates probably half the time I save loading JIRA this way!

Re: Up to 4GB of Memory in WebAssembly

#37
post #29

Earlier quoted context omitted.

I, on the other hand, wish everyone would embrace 32 bit by default. Doubling the size of every index, integer, etc comes at significant memory cost for next to no benefit. Increasing the amount of memory used directly impacts performance considering how slow memory is and how important it is to keep commonly used items in cache. If you're seriously using more than 4gb in a web page... I wouldn't mind a non-default w…

> 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 are probably right about the heap, but in the stack there are no big data structures. To move all data types to 64bits would impact the stack size of processes and threads.

Bigger data structures also mean more cache misses. So, systems would be also slower. As, bringing data from memory to the CPU is very slow compared with accessing L1 or L2 cached data.

So, you have a point. But, it does not apply equally to all data.

Re: Up to 4GB of Memory in WebAssembly

#38
post #6

Are WebAssembly projects going to display a message somewhere that says "WEB4G" when started? (disclaimer: If you're under 35 you might not get this reference)

I'm 39 and I don't get it.

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

Re: Up to 4GB of Memory in WebAssembly

#39
post #29
post #16

I wish new platforms would embrace 64 bit as the default. C and C++ for all common platforms use 32 bit literals and prefer 32 bit operations (char * short => int). Rust made a similar mistake. Java arrays use 32 bit subscripts, etc... I don't have a single computer (including my phone) using 32 bit pointers, but integers are stuck in the late 80s. (We already had 64 bit DEC alphas in the early 90s) For a web page, 4…

I, on the other hand, wish everyone would embrace 32 bit by default. Doubling the size of every index, integer, etc comes at significant memory cost for next to no benefit. Increasing the amount of memory used directly impacts performance considering how slow memory is and how important it is to keep commonly used items in cache. If you're seriously using more than 4gb in a web page... I wouldn't mind a non-default w…

On some platforms like ARM, the transition from 32bit to 64bit(Aarch64) and the improvements to the ISA allowed some software to run much quicker on the same hardware. While the increased memory usage was detrimental if you are running into memory pressure issues, the speed improvements would be well worth the change for most tasks.

When the Pi 3 launched it had a 32bit OS, but switching to 64bit improved the speed from 15 to 30% at the cost of 1.5X larger memory size.[1]

[1] https://www.cnx-software.com/2016/03/01/64-bit-arm-aarch64-i...

Re: Up to 4GB of Memory in WebAssembly

#40
post #31

Earlier 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.

[deleted]
Post reply on HN