json-streamer icon indicating copy to clipboard operation
json-streamer copied to clipboard

question about in memory accumulation

Open richardwan opened this issue 2 years ago • 1 comments

I have a question (but do not know if the issues are the appropriate place for this). if not passed a block but "lazy" is called, will the objects still accumulate in memory? for example, will objects still accmulate in memory when invoked like this?

        File.open(path, 'r') do |f|
          Json::Streamer.parser(file_io: f).get(nesting_level: 1).lazy
        end

if this does not have the desired effect, will wrapping things in Enumerator::Lazy.new help?

richardwan avatar Mar 26 '22 00:03 richardwan

Hey @richardwan, I'm not sure but there's a spec for memory usage, you can play around with that.

thisismydesign avatar Mar 26 '22 10:03 thisismydesign