Giter Site home page Giter Site logo

Comments (4)

garyrussell avatar garyrussell commented on July 23, 2024

See also #52 - in order to avoid churning Direct Buffers (when supported) we will need a wrapper for them with some kind of release() method to return a direct buffer to the pool when no longer in use. Perhaps the existing Buffer class can be enhanced to support a release() method that will detect that the buffer being released is direct, and return it to the pool.

Perhaps even non-direct ByteBuffers would benefit from being pooled, to avoid gc.

from reactor.

jbrisbin avatar jbrisbin commented on July 23, 2024

I'm working on changing some things in core to use Suppliers instead of direct references. Particularly Dispatchers, but I also was thinking that, when I get to the TCP stuff, I'll want to do a BufferSupplier as well. I also wrote the LoadingCache [1] for this purpose, so maybe we can leverage that and create a ByteBufferCache that does the rewind() when deallocating a buffer. It uses the logic that was in the BlockingQueueDispatcher, so yields the calling thread until an object becomes available (up until a timeout, then it returns a new one). It seem to work pretty well for Tasks, so no reason to think it wouldn't work for buffers as well.

[1] - https://github.com/reactor/reactor/blob/master/reactor-core/src/main/java/reactor/fn/LoadingCache.java

from reactor.

smaldini avatar smaldini commented on July 23, 2024

👍

from reactor.

wilkinsona avatar wilkinsona commented on July 23, 2024

The recent changes in Reactor TCP that Jon's working on have superseded this requirement

from reactor.

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.