HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

vJass goes insane.

04-12-2008, 09:47 PM#1
Vexorian
I just wanted to tell you all that vJass has finally reached a new level of insanity.

So, next version of jasshelper includes two changes:
- extended array size limit increased from 60000ish to 400000ish.
- Binary split for extended array size.

As for the binary split, I decided not to apply it directly, instead it will wait till there are more than 4 or 3 arrays and the remaining arrays are even. This speeds up the execution for low indexes, which are supposedly used more often. I am not sure if this assumption is good*, I might end up adding //! pragma so that you could configure the compiler, but I am leaving that stuff for the project after jasshelper.

*The problem is that there are 12 comparison max for 50 arrays. Which is double high in comparison to log_2(50) which is 5.something.

Edit: Might try with splitting after 2 comparisons.

Collapse JASS:
scope insane

 globals
     private integer array A[400000]
 endglobals

endscope

Becomes:

Expand JASS:


So, if anyone is crazy enough to require 400K array indexes and is able to make a system using them that doesn't hit the limit op, you shall feel better...




--
Edit: If anyone needs a quick vJass fix, I might be able to implement it, if I don't get any report about something like that in 2 hours I am going to upload 0.9.9.B
04-12-2008, 10:01 PM#2
TheDamien
I'm not sure if this bug has been reported yet but:
Code:
scope Zzz initializer Init
    private function Init takes nothing returns nothing
    endfunction
endscope

scope Zzz2 initializer Init
    private function Init takes nothing returns nothing
    endfunction
endscope
Gives me:
Code:
Syntax Error:

call Zzz___Init()call Zzz2___Init()

Awesome changes, by the way.
04-12-2008, 10:06 PM#3
Vexorian
The reason I decided to do this change, was actually that I found out that bug with scopes, and needed a better reason to release than such embarrassing bug.
04-12-2008, 10:10 PM#4
Gwypaas
All I can say is.... Awesome, but I wanna try looping through that array looking for 1 value :D

Btw, Cohadars EA got owned :P
04-12-2008, 10:18 PM#5
Vexorian
Quote:
Btw, Cohadars EA got owned :P
Not really.

Assimilated is a better word.

Anyways, this thing with the array [size] was implemented a couple of weeks ago already, I am just introducing a much bigger limit and the binary split.

Btw

Collapse JASS:
struct sok[400000]
integer a
//and other 30 members.
endstruct

This is likely to make your map size explode.

400K is unrealistic, but I said to myself, that if such a large value is possible, why not let people use it? Something more realistic would be 100000 or even 20000.
04-12-2008, 10:20 PM#6
Toadcop
at least... =)
now add define xD

+ 100% it need some extra identifier maybe bin ?

integer bin array A[400000] ??? so it would make it bin otherwise phail or set back to 60K.
04-12-2008, 10:21 PM#7
Vexorian
bin?
Edit: Ah, you want to make it optional? Then I really would need pragma.

Anyways, since split is not too aggressive, it doesn't affect it a lot for low sizes like 60000:

Collapse JASS:
    if(i<8191) then
        return s__Terror__Vx[i]
    elseif(i<16382) then
        return s__2Terror__Vx[i-8191]
    elseif(i<40955) then
        if(i<24573) then
            return s__3Terror__Vx[i-16382]
        elseif(i<32764) then
            return s__4Terror__Vx[i-24573]
        else
            return s__5Terror__Vx[i-32764]
        endif
    else
        if(i<49146) then
            return s__6Terror__Vx[i-40955]
        elseif(i<57337) then
            return s__7Terror__Vx[i-49146]
        else
            return s__8Terror__Vx[i-57337]
        endif
    endif

Just an extra comparison and it limits the number of necessary operations to 6 down from 8.

Tc, do you really need define? Or would you accept anything that allows inlining?
04-12-2008, 10:25 PM#8
Gwypaas
What about this:
Collapse JASS:
type int extends integer array [65255]
Should that be possible or not because right now it's not. Right now it compiles wrong and says it breaks the internal size.

I was just thinking about it because with the new bigger arrays you could fit up to 400000/4 in your own types. (If you wanna follow how it works with normal arrays and your types.)
04-12-2008, 10:33 PM#9
Vexorian
Right now you can make
Collapse JASS:
type int extends integer array [2000, 60000]

2000 is the size of each instance, and 60000 the storage limit, so you can have 30 instances of size 2000

I am improving the limit to
Collapse JASS:
type int extends integer array [12000, 400000]

Which is quite massive.
04-12-2008, 10:50 PM#10
Toadcop
Quote:
Tc, do you really need define? Or would you accept anything that allows inlining?
~ define IS somekind inline so if
Collapse JASS:
//! define lol " call echo(%)" // will allows spaces and if it would allow line breaks so it would be uber pawning but i think not. OR could you procces "\n","|n" ?  like "blab bla \n blablba" 
would be
"blab bla 
blablba" after it's inlined.


and yes the useage would be like that

lol(var_message) 

and the result would be

 call echo(var_message)
// it's just an example

about the bin arrays... in truth after 2 arrays bin split (tree) would be faster. so you can do it automaticly.
04-12-2008, 10:55 PM#11
Vexorian
Your new define looks like a line textmacro. Perhaps it is easier to implement it based of the work in text macros.

Do you need nesting for this?

Quote:
about the bin arrays... in truth after 2 arrays bin split (tree) would be faster. so you can do it automaticly.
That's kinda how it is working right now.
04-12-2008, 11:04 PM#12
Toadcop
Quote:
Your new define looks like a line textmacro. Perhaps it is easier to implement it based of the work in text macros.
yes =) i also thinked about this. but well textmacros are more powerful but need bit more coding =) (typing) 1 line define is more elegant.

Quote:
Do you need nesting for this?
i dunno. what would that mean ? =) it's kind a auto recursion ? well i think this will used not only be me so. make it so it would be better for most users. imo
04-12-2008, 11:09 PM#13
Vexorian
Quote:
Your new define looks like a line textmacro. Perhaps it is easier to implement it based of the work in text macros.
I meant that it should be easy for jasshelper to implement 'define' as a line textmacro that works kind like what you posted.

nesting:

Collapse JASS:
// temp syntax, hopefuly changes:
//! define cook(a,b,c) { $c$$a$ $b$  }
//! define cook2(a) {   cook(a,a,a)  cook(a,a,a) }


04-12-2008, 11:15 PM#14
Toadcop
yes what i thought ^^ well ok i like it =)
04-12-2008, 11:43 PM#15
PandaMine
Awesome, fast access databases FTW