Giter Site home page Giter Site logo

Comments (4)

vigna avatar vigna commented on May 25, 2024

No, you don't need to reset the arrays—they will be filled with the relevant data.

I know, the creation of those two arrays is a nuisance. One thing you could do is to have your own subclass that contains those two buffers as attributes. Of course, at that point the class is no longer thread safe, but you can implement a copy() method (as in FlyweightPrototype) that copies by reference the static data and creates a new instance with different buffers.

I think this approach would be less cumbersome for the caller than having to specify each time a new buffer.

from sux4j.

okrische avatar okrische commented on May 25, 2024

Why do i have to specifiy each time a new buffer? It is just for loops. You get once the buffer before the loop and then you use it again and again within the loop.

I thought about sub-classing. Would it really help me? I have no access to the needed private variables. So i can not copy the code. Plus its work to align it with the latest developments.
Also i share the hash function in different threads, they would all use their own buffer and i do not want to clone the hash function to keep it thread-safe (its already several megabytes)

So i still think, its the best to either have either

  • long getLong( final Object key, long[] h, int[] e) // i dont like this, as this is impl specific
  • long getLong( final Object key, GOVBuffer) // still impl specific, but does not expose the details

(Now i use even reflection to get access to this little private method getLongByTripleNoCheck)

from sux4j.

vigna avatar vigna commented on May 25, 2024

For each loop, you'd have to specify a new buffer. It would be quite combersome.

I'd rather have a method that takes two support arrays. Creating an entire data structure seems overkill. Would you like that?

from sux4j.

okrische avatar okrische commented on May 25, 2024

I agree, for each loop i have to do that. But for the method, that takes the support arrays, the same argument is valid. I additionally have to know the minimum or maximum length of the support arrays. While with a special support buffer i do not need to know this kind of detail. Its not so easy to change that detail afterwards anymore, like, when you need an array of at least 4 or 5 elements.

In any way, I would be happy to have it either way! Would speed things up a lot for me. Thank you for considering!

from sux4j.

Related Issues (11)

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.