[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12358] branches/particles/source/blender: PointCache functions for physics solvers to store their data in, includes a pointCache modifier that can read and write animation point c

GSR gsr.b3d at infernal-iceberg.com
Tue Oct 23 18:39:37 CEST 2007

emil at obsession.se (2007-10-23 at 1716.45 +0200):
> > > +             for (mv=mvert, i=0; i<totvert; mv++, i++) {
> > > +                     fwrite(&mv->co, sizeof(float), 3, fp);
> > > +             }
> >
> > Just as a side note, I suspect this to be very inefficient, doing a system
> > call per vertex. Better first make a buffer and then write that at once.
> fwrite() is not necessarily equivalent with a system call. It's a C
> standard library function, which buffers the writes. The library might
> avoid doing any system calls until you either fflush() or fclose() the
> file.
> I'm not sure what buffer sizes typical implementations use, though.

1-16K seem typical, so maybe it would be worth to use setvbuf and
change to some more K anyway. Or even gzip the streams, if after
testing CPU usage vs disk I/O shows an improvement.


More information about the Bf-committers mailing list