[REBOL] Re: New competition: do you accept the challenge?! :-)
From: sant4:wanadoo at: 7-Nov-2007 18:28
;Hi, to gain speed, remove the 'reduce
print "START..."
s1: now/time/precise
str: make string! 5000
finale: make string! 50000
blk: [i #"," j #"-"]
blk2: at blk 3
repeat i 10000 [
clear str
change blk i
repeat j 500 [
change blk2 j
insert tail str blk
]
insert tail finale copy/part next str 4
]
print "STOP!"
print length? finale
print (now/time/precise - s1)
;*** I gain a little more with that
print "START..."
s1: now/time/precise
str2: make block! 4000
finale: make string! 50000
blk: [i #"," j #"-"]
blk2: at blk 3
repeat i 10000 [
change blk i
clear str2
insert/dup str2 blk 500
str2: skip str2 2
repeat j 500 [
str2: skip change str2 j 3
]
str: to string! str2: head str2
insert tail finale copy/part next str 4
]
print "STOP!"
print length? finale
print (now/time/precise - s1)