[REBOL] Re: Shamless request for improving function speed.
From: ryanc:iesco-dms at: 28-Mar-2002 12:38
Wow Joel, I was blown away when I seen 'foreach is cruise through that
so fast. They must have improved it along the way. Anyhow, here are
some optomized versions...
; Really fast!
hyper-cycles: func [b0 [block!] b1 [block!] /local j y r] [
r: copy b0
y: length? b1
j: 1
foreach a b0 [
r: change r a + pick b1 j
j: j // y + 1
]
head r
]
; Less memory consuming, yet still fast...
lean-cycles: func [b0 [block!] b1 [block!] /local j y] [
y: length? b1
j: 1
repeat B0-I length? b0 [
poke b0 B0-I b0/:B0-I + b1/:j
J: J // y + 1
]
b0
]
--Ryan