- Joined
- Nov 7, 2014
- Messages
- 571
vJass has this feature called sized arrays which turns an array declaration like this:
into something like this:
I am curious if it's better than the hashtable native
Doesn't seem like it, I mean a function call, some comparisons and an array read
vs whatever the hell Blizzard's hashtables do.
It would be rather funny if hashtables are slower right?
So yeah this is kind of a benchmark request, kind of =)...
JASS:
globals
integer array foo[40955]
endglobals
into something like this:
JASS:
globals
// processed: integer array foo[40955]
integer array s__foo
integer array s__2foo
integer array s__3foo
integer array s__4foo
integer array s__5foo
integer array s__6foo // funny... generated but not used (silly vJass =))
endglobals
function sg__foo_get takes integer i returns integer
if(i<8191) then
return s__foo[i]
elseif(i<24573) then
if(i<16382) then
return s__2foo[i-8191]
else
return s__3foo[i-16382]
endif
elseif(i<32764) then
return s__4foo[i-24573]
else
return s__5foo[i-32764]
endif
endfunction
I am curious if it's better than the hashtable native
LoadInteger
?Doesn't seem like it, I mean a function call, some comparisons and an array read
vs whatever the hell Blizzard's hashtables do.
It would be rather funny if hashtables are slower right?
So yeah this is kind of a benchmark request, kind of =)...