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

[REBOL] Re: newlines

From: lmecir:mbox:vol:cz at: 13-Nov-2001 21:33

Hi Volker, Volker: << a bit dicussion: - i was surprised to have the fastest algorithm.
My comment was saying, that your algorithm wasn't the fastest one. Your algorithm was only measured as being the fastest, because of the nature of the measurement. (Your algorithm is faster when executed in a loop than it is when executed once.) Volker: << i tried to be simple, and to reduce the lots of large movements of remove-solutions.
Yes, that is the correct approach Volker: << - i think the handling is in response of the user. 'copy yourself if needed is rebol-style.. because often there is something parsed and completely handled, before the function is called again. used that way there is no need to copy the result. if there is need, [copy INS1 text] is short.
I wasn't saying there was any need for copying the data. What I tried to tell was, that the time we received from the measurement was incorrect, because the measurement used a false assumption, that the speed of the algorithm didn't change. Indeed, the speed measurement using that assumption must be inaccurate, because for your algorithm that assumption doesn't hold. Volker: << OTOH similar one could claim the remove-solutions destroy the string, so they should copy first? ;-)
>> >From the measurement POV the remove-solutions don't change their speed, that
is why the measured time is accurate. Volker: << - instead of post-allocation like [copy out], i could do [insert clear s out] without allocations. which may trigger some gc when lots of benchmark-loops. could you benchmark this two solutions too please? -Volker
Could you be more specific, please? Cheers Ladislav