Code Monkey home page Code Monkey logo

Comments (8)

etrepum avatar etrepum commented on July 22, 2024

https://github.com/simplejson/simplejson/tree/iterable_as_array-gh1

Does this branch solve the problem sufficiently? Note that you'll still end up materializing all of the output before returning... unless you create a JSONEncoder and call iterencode(), which will use a slower Python implementation but give you "flow control".

from simplejson.

pferreir avatar pferreir commented on July 22, 2024

+1

from simplejson.

etrepum avatar etrepum commented on July 22, 2024

Does your "+1" mean that you've tried the branch and it solves a problem you have?

from simplejson.

pferreir avatar pferreir commented on July 22, 2024

No, it was +1 for the issue, but I will give it a try.

from simplejson.

etrepum avatar etrepum commented on July 22, 2024

Since nobody seems to care, I'm going to retire this issue and leave the branch in limbo.

from simplejson.

nickbabcock avatar nickbabcock commented on July 22, 2024

I realize that this issue is very old and has been closed for a long time, but I tried out the branch and it worked swimmingly. Combining iterencode with iterable_as_array=True, allowed for me to stream json output of several gigabytes while using under 20KB of memory without resorting to the Stackoverflow hack that I'm uncomfortable with (an iterator masquerading as a list!)

from simplejson.

etrepum avatar etrepum commented on July 22, 2024

@nickbabcock Would you be interested in porting this branch back to the current master for a pull request?

from simplejson.

nickbabcock avatar nickbabcock commented on July 22, 2024

Yes, no problem. I'll create a pull request for review when I'm done.

from simplejson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.