3 ms·
I’m parsing much larger datasets than those on android, in less than 18M RAM usage. You just have to use NIO and use direct buffers instead of naively reading
by kuschku 7y ago
I’m parsing much larger datasets than those on android, in less than 18M RAM usage.
You just have to use NIO and use direct buffers instead of naively reading and allocating strings.
- nottorp 7y agoSo what's the point of using Java then? Of course I can do it in a non GC language using a buffer that holds one line and as much memory as needed for the data I want to retain...
- kuschku 7y agoDirect Buffers are a Java API to directly use C buffers and access them in a fast way. They're the fastest way to handle memory in Java.
- AtlasBarfed 7y agoNot having to worry about memory for 99% of the time. Having to do research to optimize I/O is not just a java thing. As stated before in this thread, the C stdlib isn't historically great either, and a lot of languages piggyback on that. Modern I/O is almost always a different library and you need to do reasearch.