• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CPU/memory usage measurement.

I like the discussion this has spawned, lol. Maybe someone can move this thread to Discussion?

I agree on that memory is cheap and it should be the last thing we aim to optimize.
For the record, my implementation does use a 3 dimentional array, which is only as big as the offset of the minimum coordinates and the maximum coordinates found on all sector files. My tile lookup is O(1), but the cost of that is 4gb-ish in memory (tiles with saved player items) of the original tibia 7.7 map.
 
and where should it go to get data?
you try as much as you can to keep CPU using its cache memory, of course you can't guarantee what will keep there, but is guarantee what is not.
Linked list is good when you need FIFO/LIFO
i disagree, if you need linked list for anything, you did something wrong before (i know there must be a real exception that would require it), the advantage to arrays is that a really slow read from main memory gives access to a fast cached access to multiple adjacent array elements, the same can't happen with linked lists because its nodes may be allocated in anywhere in memory
Never heard about relation between memory useage (1 or 50GB) and program speed (except case when you try to allocate big blocks of memory when memory is almost full, BUT I DONT WANT TO ALLOCATE ANYTHING! :) )
i never was about the block size, if you allocated all that memory you will have a really hard time to make it align, because as i said, your read anyway will be slow, but since cpu works with *small* raw blocks of memory, you can try to align these block in a way that cpu can cache it and perform multiple things with this same block, the ideal scenario is do something similar to STL vectors algorithm.
 
Don't ever use partial map loading for small games such as Tibia.
Only games that has waaaaay to big map for chance ever having players all over the map at same time is nearly impossible.

But when it comes to Tibia servers, better have everything loaded and ready, such a waste of time if you make the game only load map when player is close and then close it when player go away, if you'd one day find out the server getting thousands of players and entire map stays loaded forever.

And loading from disk should be avoided as much as possible, even thou the newest SSD has some really nice speeds, it can still cause some delays depending on what you're loading and what you see as proper loading time.

In an alive online game, 0.1 second load can be considered a horror.
 
I think the GC is going to hit big in the performance.
 
Back
Top