Hi,
 another little detail. In zfstream.cxx the input buffer for reading
buffered .gz files is set at page_size (4k). It is my understanding this
means files will be read at 4k chunks (uncompressed 4k). By changing the
multiplier to 16 (64k) or even 64 i could unscientifically measure a small
gain. I believe gzstream is used for terrain loading, too. I guess a value
of 16*page_size should be adecuate, not too small, small enough that it
might stay in the cache for the caller to process. This should save on
system calls, too.

Non scientific measurements, twice for each size:

original, 1 page buffer:

Airport load time: 1769
Metar load time: 7
Navaid load time: 349
Airway load time: 726

Airport load time: 1770
Metar load time: 7
Navaid load time: 348
Airway load time: 728


istream.gz buffer from 1 to 16 pages size

Airport load time: 1746
Metar load time: 7
Navaid load time: 343
Airway load time: 716

Airport load time: 1742
Metar load time: 8
Navaid load time: 343
Airway load time: 724

at 64 pages

Airport load time: 1728
Metar load time: 7
Navaid load time: 344
Airway load time: 720

Airport load time: 1736
Metar load time: 7
Navaid load time: 345
Airway load time: 728


Patch:

Index: zfstream.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/misc/zfstream.cxx,v
retrieving revision 1.5
diff -u -r1.5 zfstream.cxx
--- zfstream.cxx   25 Jul 2008 18:35:42 -0000   1.5
+++ zfstream.cxx   28 Nov 2008 17:15:05 -0000
@@ -42,7 +42,7 @@
       ibuffer(0)
 {
 //     try {
-    ibuf_size = page_size / sizeof(char);
+    ibuf_size = 16*(page_size / sizeof(char));
     ibuffer = new char [ibuf_size];
 //     } catch (...) {
 //    delete [] ibuffer;
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to