swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: optimization and C arrays (was Re: Return pointer to array: notpos


From: Marcus G. Daniels
Subject: Re: optimization and C arrays (was Re: Return pointer to array: notpossible?)
Date: 01 Apr 1999 13:04:24 -0800

>>>>> "PJ" == Paul E Johnson <address@hidden> writes:

PJ> Is it not correct that when you have a C array,
PJ> and you grab item 5 with array[4], it uses less steps than
PJ> [SomeArray atOffset:4] to retrieve the same thing?

You can call getMemberBlock on an Array to get an address you can
repeatedly dereference into. 

TB> 3) Avoid calling unnecessary operating system routines and using
TB> unnecessary I/O (especially disk I/O). 

PJ> Can you give me an idea of how I can write periodic output into memory
PJ> and then save it at the end of the run, rather using fprintf at every
PJ> timestep?  

printf is already buffered, so it should not be a massive source of
system calls.  setvbuf can be used to increase buffering, if necessary.


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]