▲ | userbinator 6 days ago | ||||||||||||||||||||||
The given task can be accomplished with not more than a few kilobytes of RAM, a constant independent of the input and output sizes, but unfortunately I suspect the vast majority of programmers now have absolutely no idea how to do so. | |||||||||||||||||||||||
▲ | shoo 6 days ago | parent | next [-] | ||||||||||||||||||||||
i can see how it'd be possible to transform from the input tabular format to the json format, streaming record by record, using a small constant amount of memory, provided the size of input records was bounded independent of the record count. need to maintain position offset into the input across records, but that's about it but, maybe we'd need to know more about how the output data is consumed to know if this would actually help much in the real application. if the next stage of processing wants to randomly access records using Get(int i), where i is the index of the item, then even if we transform the input to JSON with a constant amount of RAM, we still have to store this output JSON somewhere so we can Get those items. the blog post mentioned "padding", i didn't immediately understand what that was referring to (padding in the output format?) but i guess it must be talking about struct padding, where the items were previously stored as an array of structs, while the code in the article transposed everything into homogeneous arrays, eliminating the overhead of padding | |||||||||||||||||||||||
| |||||||||||||||||||||||
▲ | xnorswap 6 days ago | parent | prev | next [-] | ||||||||||||||||||||||
How about you enlighten us rather than just taunt us with your superior knowledge? | |||||||||||||||||||||||
| |||||||||||||||||||||||
▲ | 01HNNWZ0MV43FF 6 days ago | parent | prev | next [-] | ||||||||||||||||||||||
Okay Fermat | |||||||||||||||||||||||
▲ | Radle 6 days ago | parent | prev [-] | ||||||||||||||||||||||
Only real programmers know how to do that. |