|
Turns out it was neither. It was the actual JSON encoder I was using to return results. You hit the nail on the head. Problem solved.
From: Thijs Schreijer <thijs@thijsschreijer.nl>
Sent: Wednesday, October 5, 2022 12:43 PM To: Lua mailing list <lua-l@lists.lua.org> Subject: Re: Tables with Longs as Keys eating RAM
I’d say probably Sol. It’s a matter of modelling the data. I’ve seen the same issue with JSON encoders that check a table for integer-only keys, and then assume the thing is to be encoded as an array. This obviously ends up as one massive JSON
blob.
I don’t know Sol, but maybe add a dummy-key (non-integer) to the table, to force it to not encode as an array?
Thijs
|