uojs / uodatareader

Provides an API to read MUL/UOP files using Node.js
6 stars 0 forks source link

whether it is possible to make the entire file is loaded into memory? #6

Open lamo2k123 opened 7 years ago

lamo2k123 commented 7 years ago

@kevinhikaruevans

kevinhikaruevans commented 7 years ago

Maybe.

Working on it now, but it looks like it runs out of memory if I use native objects.

I think I can optimize it with Uint8Array (for Z) and Uint16Array (for IDs) and it might work.

lamo2k123 commented 7 years ago

loadMap use start X & Y == 1, starting blocks did not 0?

kevinhikaruevans commented 7 years ago

Yeah it should probably start at 0

lamo2k123 commented 7 years ago

loading maps in memory exceeds the default heap node. What do we do with this?

kevinhikaruevans commented 7 years ago

Need to use Int8Array and Uint16Array I think. This commit had it loading: https://github.com/kevinhikaruevans/uodatareader/commit/1913140e6368e69e18429b2f2d1306005a2d7a39?diff=unified

We could also try increasing the memory with --max-old-space-size= or by making a native library.

lamo2k123 commented 7 years ago

I think really it is necessary to return the typed arrays. I will correct.

lamo2k123 commented 7 years ago

then it will be necessary to see how much memory maps