[REBOL] Re: New competition: do you accept the challenge?! :-)
From: ale870:gm:ail at: 7-Nov-2007 9:47
Hello, I'm sorry for this delay answering, but I went to sleep (in Italy,
it was 01:00 PM).
Here I am.
Maxim, I partially understood what you say. In fact, talking about C, the
strings in C do not exist. Strings are managed using arrays or memory
allocation. Memory allocation size can be changed, so using memory
allocation to create strings are mutable (resizing memory with "realloc()"
About exponential memory allocation, it seems funny, and I cannot find a
possible reason! Regarding performance, I think it could depend from memory
manager or garbage collector algorithms (but I'm not sure!).
Tom, your code is FAASSTT but you changed the algorithm. Now I can do a
second phase process. I will create the same algorithm concept in Java, and
we'll see what happen :-)
This is another point-of-view: istead implementing code in java and "copy"
it in Rebol, I will get original code in Rebol (so it should be optimized
for it) and I'll try to convert it in Java.
I will send you the results soon ;-)
On Nov 7, 2007 6:51 AM, Tom <Tom.Conlin-gmail.com> wrote:
> Alessandro Manotti wrote:
> > yes, now I understand what you say.
> > My main target is testing how fast Rebol can handle strings. I compared
> > with java simply because java is fast, but not so fast like a real
> > application (e.g.: C++, C, Pascal, ADA, Oberon, etc...).
> > The result is import only because that one is the only way I have to be
> > that two different programming languages are implementing the same
> > algorithms (so I can compare them).
> but part of rebol is *not* having to implement the same algorithms.
> rebol 
> print "START..."
> s1: now/time/precise
> finale: make string! 48000
> i: 1
> while[i <= 10000][
> insert tail finale copy/part next trim/all form reduce[i ",1-" i] 4
> i: 1 + i
> print "STOP!"
> print length? finale
> print now/time/precise - s1
> > I think we need to optimize Rebol code using specific tokens (e.g.: I
> > "append" but now I discovered that "insert tail" is faster because it is
> > native... this is an important optimization).
> > Obviously, if can change the algorithm and you reach the same result,
> > you didn't work on Rebol code, but on programming logic. It means we
> > apply such optimization even in the java code.
> > If you have a better idea or suggestions in order to check it, please
> > hesitate to help me to find a better way (I started this "competition"
> > I'm creating some rebol cgi, and I asked to myself if rebol will be
> > or slower than java ). Of course java server is another technology (not
> > cgi), but now I wish to analyze tha language performances based on the
> > logic and algorithms.
> > I think we could apply a different logic/algorithms only if we find a
> > trick that could be never applied in java since the "concept" could not
> > immplemented in java self.
> > On Nov 7, 2007 12:48 AM, Gregg Irwin <gregg-pointillistic.com> wrote:
> >> Hi Alessandro,
> >> AM> obviously we need to achieve the same result (else the comparison
> >> AM> fail!), but we need to optimize rebol program.
> >> AM> Basically we need to maintain the program "logic" (loops, etc...).
> >> If we achieve the same result, why does the program logic have to be
> >> the same? If the result is important, then we need to know what the
> >> *specific* output format is, and what drives its generation (so we can
> >> get creative in how we generate it). If the logic is important, then
> >> it's just brute force, testing REBOL's string handling performance, and
> >> there are many less options for optimization.
> >> -- Gregg
> >> --
> >> To unsubscribe from the list, just send an email to
> >> lists at rebol.com with unsubscribe as the subject.
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.