[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

Stephen Swaney sswaney at centurytel.net
Tue Oct 23 18:17:36 CEST 2007

On Tue, Oct 23, 2007 at 05:24:03PM +0200, Alexander Ewering wrote:
> On Tue, 23 Oct 2007, Emil Brink wrote:
> > 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.
> Sure, but still, doing a million nested function calls (and god knows what
> hides behind the particular fwrite() implementation) (and a vertex count of
> one million might even be realistic for physics models) doesn't really sound
> that fast -- especially as a cache is meant for speeding up things, its
> implementation should probably be optimal :)

This falls into the category of 'ant f*cking', to use that charming
Dutch expression.  Since the write is buffered, it is the equivalent
of a memcopy to the i/o buffer and a check to see of there is enough 
stuff to flush to disk.

As Knuth or somebody says: "Premature optimization is the root of all
evil".  Better to write working, readable code and then profile it
to find the slow spots.  Experience says they are not where you think
they are.

Stephen Swaney			
sswaney at centurytel.net

More information about the Bf-committers mailing list