Mapping versus caching

Want to discuss changes to the UOX3 source code? Got a code-snippet you'd like to post? Anything related to coding/programming goes here!
Post Reply
punt
VIP
Posts: 244
Joined: Wed Mar 24, 2004 7:46 pm
Has thanked: 0
Been thanked: 9 times

Mapping versus caching

Post by punt »

Many places uox caches the mul data.

Looking at it, one may have a cleaner code if one mapped the files instead.

One could map the entire index files, and then map just a location of the data files (that becomes the "cache" so to speak.

Just a consideration.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Just curious - are there any "visible" differences between the two methods, performance-wise for instance?
-= Ho Eyo He Hum =-
punt
VIP
Posts: 244
Joined: Wed Mar 24, 2004 7:46 pm
Has thanked: 0
Been thanked: 9 times

Post by punt »

could be, yes.

Mapping does a few things:
1. Lets one share edits between process (so if one writes back, the other can get it)
2. The mapping to memory is handle by the OS. So depending on the size, it can be faster.

3. Cleanup can be nicer.


I recognize it won' make a big difference for UOX3 at this point. Other then perhaps cleaner code (and less), and perhaps faster startup. But it seemed like appropriate for discussion in this forum
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

If anything can be done to speed up world-saves I'm in.

It takes about 4-5 min. now for me to start a server, which is ok. But my world saves now take 28-39 seconds, and that pauses the action.
punt
VIP
Posts: 244
Joined: Wed Mar 24, 2004 7:46 pm
Has thanked: 0
Been thanked: 9 times

Post by punt »

Well, in theory one could redo world saving to handle being a memory mapped, but that I think would be later.

I was suggesting a crawl/walk approach, and perhaps tackle the caching ones first.
Post Reply