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

[REBOL] Re: newlines

From: nitsch-lists:netcologne at: 14-Nov-2001 9:53

RE: [REBOL] Re: newlines regarding my last mail: ups, misreaded benchmark-list. kill the gc-notes: << keep in mind not to trigger unfair gc's because of a non-real-world amount of loops and therefore garbage. it looks the most time competing algorithm at 10000 slows down heavily with 30000 without good reason. it uses parse too, but with copy instead of markers, so it produces more garbage. could go over a limit with 30000 so it starts triggering gc's. so benchmarking with different loop-counts (=different amount of garbage) is a good idea.
as fast as CS is PARCHAN with every amount, with xxxxx..... and x......... . with xxxxxxxxx. its half as fast. it uses [copy u], which fills heap too. so gc is no problem. and allocation should not slow down. hmm, could both be combined? until change/part speeds up :-) for real-world problem, there is one replacement each paragraph, so there are a lot more x compared to ".". this should be favourable for remove-versions, because they have a lot fewer to do. so a benchmark with lots of "x" too? this where PARCHAN and CS : comment {a copy-like algorithm} PARCHAN: [ method6: [ to "..." 2 skip t: sub | to end ] sub: [ any [ any #"." copy u [ to "..." 2 skip (w: [(t: change t u)]) | end (w: [(clear t) end skip]) | to end (w: [(clear change t u) end skip]) ] w ] ] parse/all s method6 ] comment {Volker's COPY-based algorithm} CS: [ out: clear "" parse/all s [any [ start: thru "..." end1: any "." (insert/part tail out start back end1) ]] insert tail out start out ] -Volker [joel--neely--fedex--com] wrote: