1. RE: Euphoria implementation

-------Phoenix-Boundary-07081998-

Hi Shawn Pringle, you wrote on 3/17/02 7:19:03 PM:

>
>There has been talk of changing Euphoria.  For me it is better to
>make functions cheaper or at least less time consuming ot execute if
>possible because it means that less programmers will hvae to inline
>things and forgo using functions in many places.
>
>In the Performance documentation it says:
>It is cheaper to copy to a temporary modify the temporary and then
>assign the temporary variable back to the original.  See the part
>on indexing.  It goes on to say that the line
>xi = x[i]
>"only copies the pointer..."
>Inspite of xi being modified later Euphoria doesn't make another
>copy of xi which is good as in this case x[i] will be reassigned
>xi.
>
>I think it is a natural extension of this idea to have statements
>like this: "n = foo(n)" pass by reference.  As it makes
>no difference to the functionality of the program. Ofcourse things
>like "x = foo(n)" would be pass by value as it is now.  The benifit
>is that many programs would get faster for nothing.
>

Don't be too sure. Having worked with the source for a month now,
I am amazed by how well optimized the code is. Time and again I
have implemented an optimization, only to see the speed fall by
10%. It generally (always, in my experience) takes more time to
check for the optimization (is the left side and the parameter
the same?) than is saved by the 'better' code!

Karl Bochert

-------Phoenix-Boundary-07081998---

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu