HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Gamecache vs. other (dynamic) alternatives

07-25-2006, 01:41 PM#1
Vexorian
This is what I attempted to have the other day but the discussion went off topic and I didn't include the right map

Gamecache version: fole.w3x

New version: FrozenOrb.w3x

Would want people to test both maps and tell me if there was a difference speed wise, I made both of them have the same settings including timer and duration.

In both maps there is a trigger that will make the 3 archmages cast frozen orb simultaneously when you press escape


--
Keep the discussions about the supposed gamecache bugs in the other threads
Attached Files
File type: w3xfole.w3x (196.9 KB)
File type: w3xFrozenOrb.w3x (213.9 KB)
07-25-2006, 01:50 PM#2
The)TideHunter(
Im just downloading the maps now, il edit my post with my findings in a sec.
07-25-2006, 01:53 PM#3
iNfraNe
The gamecache version lagged pretty bad. However, the new version had only a slight lag at the end of the spell.

Which means: the new version was definately alot faster. gj :)
07-25-2006, 01:58 PM#4
emjlr3
i think the lag at the end is causes because, as the orb goes, it throws the shards around, but at the very end, it shoots shards in all directions all at once( duno y really, havent delved into the code)
07-25-2006, 01:58 PM#5
BertTheJasser
Same as iNfraNe.
07-25-2006, 01:58 PM#6
The)TideHunter(
I agree, the GC version had 3 lag spurts near the end, but the newer only had 1 at the end, its definatly better.
07-25-2006, 02:02 PM#7
Vexorian
The lag at the end is because it spawns much more bolts and much more bolts × 3 equals a lot of processing
07-27-2006, 02:54 AM#8
TheEpigoni
Vex, most of the stuff in here is pretty brilliant. Good show. I'm still reading through it and I have a few questions though.

First one may seem a bit silly, but why do you initialize the arrays as size 1 and then expand them to the full 8192 in your script?


Another quick one, when you initialize your fibonacci sequence for the list of indexes you initialize it past 144 because you use a for the a<144 check, but the loop goes to b = 233 and stores that value before the loop exists. Might be a bug, might not matter, just noticed an inconsistency.

In fact the point where your comment says //i is 145, it's actually 378. Once again, just wondering why the inconsistency, nothing more.

It seems you're using the fibonacci sequence to set up indexes for arrays of varrying sizes. Can you please explain the significance of this? Does it guarantee no wasted space when allocating/deallocating "memory"?

It appears that you're still using the gamecache to store the actual handle which refers to the object. This is a bit confusing because I now don't really understand where the actual gain in performance is from?

Wouldn't it make more sense to use the gamecache for nothing but holding the index in a storage array and hold the handles that point to actual objects in the storage array?

Might have a few more questions if I come up with any other trixy way of using these techniques myself...
07-27-2006, 03:14 AM#9
PipeDream
geometric sequences with integer bases and the fibonacci series are convenient for block sizes because you can split a big block in to smaller blocks in O(1) time. The space you waste is roughly proportional to the ratio between block sizes. The slowest growing integer base is 2 (1,2,4,8 vs 1,3,9,27). Fibonacci sequence on the other hand grow asymptotically at ((1+sqrt(5))/2)^n or about 1.6^n. So its space performance is better with out requiring many more breaks when you have a huge block and need a small one.

http://www.wc3campaigns.net/showthread.php?t=85135
07-27-2006, 03:18 AM#10
TheEpigoni
I see, I'll continue the discussion in the linked thread.
07-27-2006, 12:21 PM#11
Toadcop
Ofc arrays are better ! whats why my TPC use only arrays !
Alexey B.H. (Cacodemon) School =)
07-27-2006, 12:45 PM#12
Vexorian
Quote:
Vex, most of the stuff in here is pretty brilliant.

It all started with peppar's heap, then I made changes then Pipedream made suggestions it has gone crazy the result is kind of awesome.

Quote:
Good show. I'm still reading through it and I have a few questions though.

First one may seem a bit silly, but why do you initialize the arrays as size 1 and then expand them to the full 8192 in your script?
What when?


Quote:
Another quick one, when you initialize your fibonacci sequence for the list of indexes you initialize it past 144 because you use a for the a<144 check,
yep the exitwhen should have b
Quote:
but the loop goes to b = 233 and stores that value before the loop exists. Might be a bug, might not matter, just noticed an inconsistency.

In fact the point where your comment says //i is 145, it's actually 378. Once again, just wondering why the inconsistency, nothing more.
Nope it would be 234.

Edit: Oh you are right it would have been 378 , the exitwhen should be exitwhen (b>144) and that should go after assigning to b

It is good that I read this post I was just about to release new CSCache

Quote:
It seems you're using the fibonacci sequence to set up indexes for arrays of varrying sizes. Can you please explain the significance of this? Does it guarantee no wasted space when allocating/deallocating "memory"?
It doesn't grow too fast.

Quote:
It appears that you're still using the gamecache to store the actual handle which refers to the object.

This is a bit confusing because I now don't really understand where the actual gain in performance is from?


I use gamecache to store the array's id that is used by a handle.

I tried an alternative to gamecache to store a value for a handle, but everything I tried resulted much slower or less flexible than gamecache.

But since I only store/read gamecache once it is much faster than storing a lot of things in gamecache