TannerRogalsky / love.js

LÖVE ported to the web using Emscripten
MIT License
493 stars 53 forks source link

How to increase TOTAL_MEMORY for release_performance? #48

Closed hollunder closed 7 years ago

hollunder commented 7 years ago

My game seems to require that. However, I can't figure out how to actually do it. Recompile emscripten somehow? Could you give an example please?

TannerRogalsky commented 7 years ago

TOTAL_MEMORY is another flag that can be set on the Module object.

See this test for an example of how to set it at runtime and this configuration for the default value of that setting.

hollunder commented 7 years ago

Thanks, the runtime example worked for me. I wouldn't know what to do with the config thing.

I added these lines to the html file in the Modules section:

        buffer: new ArrayBuffer(32*1024*1024),
        TOTAL_MEMORY: 32*1024*1024,

Except that I had to increase the memory (I simply used times 2).

Whether the ArrayBuffer line was necessary I don't know, but it seemed reasonable to include it.

The performance increase was significant compared to the compatibility. The game is now playable in Firefox as well.