I've seen discussions about Javolution being overused in the project and I'd like to have some more info about this.
In which situations javolution collections are more suitable and which not?
Also, what's the difference between using it in shared mode and using Concurrent java colletions?
One of differences is that FastMap keeps its elements sorted by the way you've stored them, but ConcurrentHashMap doesn't it keeps them randomly sorted.
Also we are replacing javolution at the places that we can use native java concurrent collections.
UnAfraid wrote:
Also we are replacing javolution at the places that we can use native java concurrent collections.
Thanks for the reply.
But what's the criteria for this replacement?
Most of FastMaps can be safely replaced with ConcurrentHashMap (Of course where sorting doesn't matters) but some FastLists cannot be replaced with CopyOnWriteArrayList for example due to some issues for example i've replaced the lists in Olympiad that holds participants and i end up into a problem having players 'unregistered' but they wasn't or player registered into few fights at the same time and stuff like that.
That's not really a proper answer to his question...
I'm pretty sure he meant why do you choose to replace x with y, based on what criteria? Is it actually better in that specific scenario or you just like it that way?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste! Discussion breeds innovation.
UnAfraid wrote:
Also we are replacing javolution at the places that we can use native java concurrent collections.
Thanks for the reply.
But what's the criteria for this replacement?
Most of FastMaps can be safely replaced with ConcurrentHashMap (Of course where sorting doesn't matters) but some FastLists cannot be replaced with CopyOnWriteArrayList for example due to some issues for example i've replaced the lists in Olympiad that holds participants and i end up into a problem having players 'unregistered' but they wasn't or player registered into few fights at the same time and stuff like that.
I see, thank you
jurchiks wrote:I'm pretty sure he meant why do you choose to replace x with y, based on what criteria? Is it actually better in that specific scenario or you just like it that way?
Actually yes, I'd like to know better the cases I should choose between javolution and java libraries
I'd also like to know why one should use java-native maps and lists. Javolution suggests on their page, that their maps and lists are better and faster (at least in those cases they offer). So I'd also like to know why and when one should prefer one over the other.
Thanks in advance.
I don't mind helping - however: I only do so if I want to. No support for other server packs than L2J.
Hyrelius wrote:I'd also like to know why one should use java-native maps and lists. Javolution suggests on their page, that their maps and lists are better and faster (at least in those cases they offer). So I'd also like to know why and when one should prefer one over the other.
Thanks in advance.
If I made a collection API, I'd like to believe it's better than what I'm leaving behind
Powered by Eclipse 4.34 | Eclipse Temurin 21 | MariaDB 11.3.2 | L2J Server 2.6.3.0 - High Five
Zoey76 wrote:If I made a collection API, I'd like to believe it's better than what I'm leaving behind
You don't think they have made tests to prove their code is faster?
Everyone knows that the Java collections are for general use, they're all-rounders, not particularly good at anything, but not all that bad either, while libraries like Javolution and Trove specialize and excel at something in particular (storing time or retrieval time, among other things).
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste! Discussion breeds innovation.
To properly answer the OP question, one must sit and review the source code from Javolution (included in our source) and the source code of Java itself (included in any JDK).
Still, there is bound to be some custom collection that is faster than the built-in one.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste! Discussion breeds innovation.