[Radiance-dev] setting buffer size on octree reads (setvbuf)

Peter Apian-Bennewitz apian at pab-opto.de
Mon Apr 28 11:39:52 PDT 2008


Hi Greg,

regarding the long time it takes reading octrees (multiple with sizes > 50MB):

I've tested with setvbuf calls after the fopen in readoct and readobj with a 
size of 2MB (system default is 4kB).

Well- the number of reads went down, but the time for reading remained 
unchanged: 2.47min down from 2.48min.
It seems truly CPU (Xeon) limited, at least in this case, when reading from 
local disk (bandwidth>20MB).
Nevertheless, using a larger buffer than the default 4kB may make sense. E.g. in 
other scenarios (might be usable on NFS reads where mount rsize is larger than 
4k), with a minor chance of portability problems ("The setbuf() and setvbuf() 
functions conform to C89 and C99" it says in the man page). Ah, well, setbuf is 
already in use for setting up the ambient file. IMHO it might be a good thing to 
add to readoct, unless rendering is done on systems where an increased buffer 
takes away a significant part of valuable mem.

-Peter

PS: Tested on fresh 'head'  -  cc to the dev list in case anyone stumbles 
across, comments appreciated.
-- 
pab-opto, Freiburg, Germany, http://www.pab-opto.de
[see web page to check digital email signature]






More information about the Radiance-dev mailing list