Re: Euphoria Compilers Available Soon

new topic     » goto parent     » topic index » view thread      » older message » newer message

>"Mike the Spike" wrote:
>
> > A sequence is just an array that can
> > have other elements appended/prepended
> > to it.
>
>OK. just for grins let's assume that you create a 'sequence' as a list of
>pointers:
>
>    { ptr1, ptr2, ptr3, ptr4 ... ptrN }
>
>Right away, you are slower than RDS when working with sequences, because in
>order to get the value at the other end of the pointer, you need to fetch
>the value the pointer is pointing to. In contrast, RDS uses one of the 32
>bits to flag if the value is a number, so when dealing with sequences
>filled
>with numbers, they have one less fetch than you do, right off the bat.
>
>This ignores the obvious question: what kind of data is your pointer
>pointing to, anyway? It's not enough that you can fill the sequence with
>arbitrary data; you need to be able to read it out. But simply storing the
>pointer is lossy - you've got to store a data type flag somewhere, either
>in
>the sequence or with the data. I'll just gloss over this important point,
>and move on to maintaining data integtity in structures: something your
>approach doesn't do. Methinks that this will slow down your benchmark a bit
>more.
>
>Even more importantly, what happens when you have something like this?
>
>    s1 = { 1,2 }
>    s2 = { s1 }
>
>If you implement it like this:
>
>    s1 --> { ptr1, ptr2 }
>    s2 --> { ptr3 }
>    ptr1 --> 1
>    ptr2 --> 2
>    ptr3 --> s1
>
>then your code *breaks* when an operation like this is performed:
>
>    s[2] = 3
>
>because the data structure now looks like this:
>
>    s1 --> { ptr1, ptr4 }
>    s2 --> { ptr3 }
>    ptr1 --> 1
>    ptr2 --> 2
>    ptr3 --> s1
>    ptr4 --> 3
>
>and the sequences contain:
>
>    s1 = { 1, 3 }
>    s2 = { { 1, 3 } }
>
>instead of:
>
>    s1 = { 1, 3 }
>    s2 = { { 1, 2 } }
>
>After you finish adding reference counting, indirection and garbage
>collection to your code, try performing those benchmarks again - I don't
>think even the fanciest compiler is going to be much help in running faster
>than Euphoria.
>
>-- David Cuny

I only gave you a snippet,that's not the whole cake I posted.
The key is that "I don't have to know what the datatypes are".
I don't care.
Why should I know what the datatypes are?
Euphoria programs don't have to care.
So neighter should the compiler.
It doesn't matter if you are adding two sequences,two floats or a float and
a sequence in arith, they can all be added!
I turn a single sequence to a single array and that's all it needs.

You don't know how RDS realy implemented them,it could be just like this,you
need the source to be sure.
Allthough this gets translated to ASM in U4IA++,offcourse.
In contrast,this approach is faster when compiled,you can't just say that a
programming language (Eu) that gets 3000 Sorts per second on a  benchmark,
and a Visual C++ port gets 31.000 sorts per second, its slower then
Euphoria.
It takes 7 seconds to spawn a large Eu app once you click on it in Windows,
even if that app doesn't do anything but draw a window,yet it has a large
library (ex. winapi.ew). You have to weigh out every slice of code with Eu,
if you took the libraries that a normal Win32 C++ program includes, and add
it to a Euphoria program, you can be waiting for many minutes before you
even see anything on the screen.
I just can't believe why you are saying that Euphoria is as fast as compiled
C/C++ no matter what sequence approach I use (with a real modern compiler
offcourse,not some crap from the seventies).

Mike The Spike
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu