swarm-support
[Top][All Lists]
Advanced

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

Re: Return pointer to array: not possible?


From: Marcus G. Daniels
Subject: Re: Return pointer to array: not possible?
Date: 01 Apr 1999 09:30:03 -0800

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

PJ> This saves
PJ> me the overhead of using the Swarm type Array, you see, and when
PJ> there are millions of agents, I think it has significant speed
PJ> implications.

I suggest you keep in mind what Miles Parker said at SwarmFest: 

When you are tempted to start looking for magic compiler flags to
unroll loops, etc. (or in this case move to lower level data
structures), it's time to take a coffee break and think more about the
problem.  Yes you will save a little bit of memory using a C array
instead of a Swarm collections Array, but you have to balance the
comprimised clarity of your model against the performance increase,
which in this case won't be more than a few percent, I expect.

Please don't take this as a flame, but here is some more advice: 
if you can't take the time to read the C manual to learn about a (simple)
feature you think *might* be useful, then don't use that feature
*even* if someone on this list is so kind as to show you a prototype
of its use.  That's a reckless and insidious kind of programming.

Always have the goal of understanding what you are doing.


                  ==================================
   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]