Comments (4)
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.
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.
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.
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)
- ASL 2.0 HOT 1
- ZFastTrie.pred seems broken HOT 7
- no way to disable debug messages HOT 1
- EliasFanoMonotoneBigLongBigList is accidentally limited by LongArrayBitVector function HOT 15
- Cannot retrieve provided arbitrary values when querying GOVMinimalPerfectHashFunction HOT 2
- Elias-Fano encoding fails to handle BitVectors with values greater than Integer.MAX_VALUE HOT 1
- ZFastTrie - null pointer on add operation HOT 1
- Can you show how to run an example? HOT 5
- ArrayIndexOutOfBoundsException when using large set of keys with CHDMinimalPerfectHashFunction HOT 2
- You provided no keys, but the bucketed hash store was not checked HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sux4j.