Snippet List Optimum Speed

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
For real life usage? :) Put it in demo map. I believe you can use it to make a poker card games.
brows.gif
 

Nestharus

o-o
Reaction score
84
Added some decent documentation with a description of each thing in this as well as how to use each thing. The API that was included in the code was just that, an API =p.


As for a demo map, that would be very silly for this.

Syntax cannot be fixed unless it is done in cJASS (unless Zinc has added definitions). You use vJASS and you get bad syntax and that's about all there is to it.
 

Romek

Super Moderator
Reaction score
964
cJass isn't supported here anyway.
 

Nestharus

o-o
Reaction score
84
The only thing that was more difficult to use than to write yourself was indexed arrays, which is why it wasn't included ; ). I know I said that in the guide : P.

I know I said that somewhere
Why not indexed memory? Indexed memory is so simple that'd it'd actually be harder using macros than writing it from scratch ><.

As for namespaces, I know I've had instances where I needed multiple lists going on at once in a given space. Normally I'd use multiple structs for this, but as there is no inline keyword, I have to do it thru definitions/macros : (.

Now, with the default implements and so on, it just uses a default namespace. Remember, there are different layers of APIs. Now if macros had overloaded arguments then I could make them do a default namespace argument too. I see no reason why to remove namespace as I do provide the default and then go on to provide custom if the user chooses to have it.

So this has a heap, dequeue, stack, and queue in it I believe.

Also you could easily write a little utility using this for dequeues etc that is faster than the current ones ; ), but I did it this way because there are a few ways to do these things. I know one time I did allocation based on 2D array slots, and another time based on ids. I've also done single instance dequeues and multi instance dequeues, so again, that's why this is in a macro form rather than a hardcoded form. It's meant to be a framework because there are too many variants of what can be done with these collections. It simple provides the basic operations so you don't have to do them over and over again.

Yes, the API is ugly at the macro layer, but if you do learn it it can be a time saver : ). If there were inline methods, I'd certainly do it through methods instead to get rid of a lot of the args and make the interface easier to deal with. Also, if there were definitions in Zinc (not sure if Vex added them yet), I'd certain move the macros towards an XML/OO style code block.

And remember, there is always a pretty powerful default namespace module API that's pretty and a super simple default collection that'd be more like those other systems but implemented like a regular dequeue with a head and a tail to save on add/remove operations.
 

Nestharus

o-o
Reaction score
84
I'll write another guide then on Tuesday. Sunday and Monday I'm going to be way too busy to deal with this.
 

Romek

Super Moderator
Reaction score
964
People usually opt for a neat balance of ease of use and speed of code in JASS. Most lean towards ease of use as this is JASS, not real programming. Speed isn't of as much concern at all, and nobody will ever tell the difference between a 'fast' or 'slow' system; whereas the ease of use of systems is relatively important.

This system completely sacrifices ease of use for the sake of speed, and therefore has the ugliest interface I've seen to date in any system. And the advantages of this over a system with a [del]nice[/del] remotely usable interface? This one's 0.1 nanoseconds faster. :)

Is it worth it? Of course not.
Please, quit this obsession with 'fast' code.
 

Nestharus

o-o
Reaction score
84
Again, rewriting the guide because the first layer's API is just as easy to use as any system out there =). I made this with the knowledge that the lowest layer was seriously insane, hence 3 layers. Middle is only semi-insane. Today I don't have enough time to write it.

First layer is just implementing 2 modules, the heap and the collection type, so it's mainly just about using the methods like add, remove, etc.
 

Sevion

The DIY Ninja
Reaction score
413
I really have to agree with Romek on this one. The interface is horrible -_-' This snippet isn't user-friendly at all.
 

Sevion

The DIY Ninja
Reaction score
413
Why do you continue to refuse to explain why people should use your snippets/systems over others.

You explain nothing about why I should use:

JASS:
struct myStruct extends array
    implement MallocStruct
    // yada yada
endstruct


over

JASS:
struct myStruct
    // yada yada
endstruct


You don't exactly explain anything -_-'

And no, a Wikipedia article is not "explaining".

Also, "that's part of vjass" isn't a valid reason to not explain.
 

Nestharus

o-o
Reaction score
84
Because using regular structs is asking for a world of invisible background code trouble, like random triggers for destroy and create, triggers for virtually every method you add, chained allocation (when the instances should just be sync'd), and etc... sure, I agree with chained creation and what not, but only in cases where you are performing ini. I mean, that's a standard practice ; |. Chained allocation is a standard practice too, but you don't need that for vjass because structs are just arrays and you can only have 8190 instances meaning you might as well base the instances off of a root struct.


Anyways, all of this background code just makes me always want to do [ljass]struct extends array[/ljass] because that has 0 background code. It allows me to take advantage of the nice OO syntax and avoid the hassle of the code I despise. Every struct I ever make always extends an array. For extending other structs, I do a variety of tricks since delegates require syncing....


Anyways, malloc allows standard memory allocation that is easy to write and customize for structs that extend arrays.

to me, [ljass]struct extends array[/ljass] is a much smarter way to go. It's how I always do things and having a malloc thing for writing allocate methods is better than writing it from scratch every time and better than standard struct background code.

Vexorian was doing hybrid class/struct craziness >.<.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
> Vexorian was doing hybrid class/struct craziness >.<.

The entire concept of vJASS is craziness, though pure insanity would be a better explaination.
 

Nestharus

o-o
Reaction score
84
Changes
Ok, made loads of changes and planning to make a few more.

Dequeues
  • Made a special style of malloc for dequeues
  • Changed dequeue design to single head
  • Moved to spiffy link style operations
  • Added pop, push, shift, and unshift operations for dequeue

Dmalloc
  • includes allocate, allocateCount, and deallocate(node1, node2)
  • 2 fields instead of the standard 3
  • freed instances are stored in a sort stack instead of a freed array to take advantage of the links. .previous and .next are updated etc, but it works like a stack. This allows large numbers of nodes to be deallocated without a loop.


Planned additions-
  • SMalloc, or special malloc for Stacks
  • Queue


Differences between these collections and others
These collections specialize in ranged operations. If you are only dealing with single operations and never plan on dealing with ranges, you can still use these as they do have specialized single operations, but some situations might be a little slower.

I believe that these are the only collections at the moment on any of the sites that do specialize in range operations, so this shouldn't be in the graveyard ; P.

I could add more that specialize in single operations and follow the same design style as these things if people want, but there are already tons of things out there that do single operations.

This follows a unique 3 layer design style.

Layer 1 is probably the layer most people would use and is just like any other library you might use, implement the module and use the methods.

Layer 2 is used for writing methods, which can then be packed into a module.

Layer 3 is used for writing modules, which can be packed into methods, which can be packed into a single module.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top