Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: New competition: do you accept the challenge?! :-)

From: ale870:g:mail at: 7-Nov-2007 17:23

I'm sorry, but it seems it doesn't work. Look at my test:
>> series: "Hello Rebol"
== "Hello Rebol"
>> series: insert series "!!!"
== "Hello Rebol"
>> print series
Hello Rebol
>>
series is not updated. What's wrong? On Nov 7, 2007 4:44 PM, Maxim Olivier-Adlhoch <moliad-gmail.com> wrote:
> another optimisation > > instead of : > > insert tail series value > > do > > series: insert series value > > -MAx > > On 11/7/07, Alessandro Manotti <ale870-gmail.com> wrote: > > > > Hello Petr, your job is really what I was talking about. > > You maintained the main algorithm, but you optimized it with several > > tricks. > > > > Thank you to Carl for your suggestion. I think such tricks are very > > important, to better know Rebol structure and internal functioning. > > > > > > > > > > On Nov 7, 2007 9:47 AM, Alessandro Manotti <ale870-gmail.com> wrote: > > > > > 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 it > > > > > with java simply because java is fast, but not so fast like a real > > > > compiled > > > > > 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 sure > > > > > 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 > > > > > > > > halt > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I think we need to optimize Rebol code using specific tokens (e.g > .: > > I > > > > used > > > > > "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, > > > > maybe > > > > > you didn't work on Rebol code, but on programming logic. It means > we > > > > should > > > > > apply such optimization even in the java code. > > > > > > > > > > If you have a better idea or suggestions in order to check it, > > please > > > > don't > > > > > hesitate to help me to find a better way (I started this > > "competition" > > > > since > > > > > I'm creating some rebol cgi, and I asked to myself if rebol will > be > > > > faster > > > > > 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 > > > > same > > > > > logic and algorithms. > > > > > I think we could apply a different logic/algorithms only if we > find > > a > > > > rebol > > > > > trick that could be never applied in java since the "concept" > could > > > > not be > > > > > 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 > > > > will > > > > >> 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. > > > > > > > > > > > > > > > > > -- > > > > > > //Alessandro > > > > > > http://sguish.wordpress.com > > > http://laccio.wordpress.com > > > > > > > > > > > -- > > > > //Alessandro > > > > http://sguish.wordpress.com > > http://laccio.wordpress.com > > > > > > -- > > 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. >
-- //Alessandro http://sguish.wordpress.com http://laccio.wordpress.com