Code Monkey home page Code Monkey logo

Comments (4)

kxepal avatar kxepal commented on May 18, 2024

Are memory overhead and performance degradation due to message passing significant? If not, advantages are too good to ignore them.

from hackney.

Licenser avatar Licenser commented on May 18, 2024

I would like to call out for caution here for the way the GC handles big data. Since it will propably mean sending big binaries around it can lead to keeping a lot of things in memory - I faced exactly that issue [2] when sending chunks read from hackney over messages to another process.

Worst case this could mean that the entire streamed body stays in memory until the hackney streaming process dies (and GC's obviouslly).

@dieswaytoofast has an excelent blog post [1] on that issue (that saved my the behind when I ran into this issue) and I highly recommend reading before this change.

I would opt for keeping both around, let people choose what's right for them like other network sockets work with either async or non async giving different ways to handle reading from the socket. That gives the advantage of staying in line with gen_tcp/udp at least from the philosophy.

[1] http://dieswaytoofast.blogspot.de/2012/12/erlang-binaries-and-garbage-collection.html
[2] https://github.com/project-fifo/sniffle/blob/dev/apps/sniffle/src/sniffle_img_vnode.erl#L345

from hackney.

benoitc avatar benoitc commented on May 18, 2024

@kxepal I am trying to see about the real impact, I forgot to add the GC one, thx @Licenser for the link :)

from hackney.

benoitc avatar benoitc commented on May 18, 2024

Adding 2 links around this topic to keep a trace somewhere:

http://jlouisramblings.blogspot.fr/2013/10/embrace-copying.html from @jlouis

and

https://blog.heroku.com/archives/2013/11/7/logplex-down-the-rabbit-hole from @ferd

from hackney.

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.