08-07-2003, 02:57 PM
SCM has identified a drastic speed improvement in my Mandelbrot programs - The same rule can apply to other cases...
I had written x#^2 - y#^2 in the main loop. SCM changed that to :
x#*x# - y#*y#. Speed is increased more than twice !
So I made a small benchmark, to compare three writings for the same numeric result, with and without Ffix:
Without Ffix:
x!^2 - y!^2 : Speed index 100
x!*x! - y!*y!: Speed index 224
(x!+y!)*(x!-y!): Speed index 224
x#^2 - y#^2 : Speed index 100
x#*x# - y#*y#: Speed index 228
(x#+y#)*(x#-y#): Speed index 224
With Ffix:
x!^2 - y!^2 : Speed index 224
x!*x! - y!*y!: Speed index 1345
(x!+y!)*(x!-y!): Speed index 1345
x#^2 - y#^2 : Speed index 224
x#*x# - y#*y#: Speed index 1345
(x#+y#)*(x#-y#): Speed index 1345
Needless to say I have adapted all my progs... My old Screen 12 Mandelbrot Explorer draws the first pic (300x300) in 5 seconds now, instead of 27 seconds last year ! And the SVGA version I issued last month is, at least, confortable...
Sattamassagana, SCM !
I had written x#^2 - y#^2 in the main loop. SCM changed that to :
x#*x# - y#*y#. Speed is increased more than twice !
So I made a small benchmark, to compare three writings for the same numeric result, with and without Ffix:
Without Ffix:
x!^2 - y!^2 : Speed index 100
x!*x! - y!*y!: Speed index 224
(x!+y!)*(x!-y!): Speed index 224
x#^2 - y#^2 : Speed index 100
x#*x# - y#*y#: Speed index 228
(x#+y#)*(x#-y#): Speed index 224
With Ffix:
x!^2 - y!^2 : Speed index 224
x!*x! - y!*y!: Speed index 1345
(x!+y!)*(x!-y!): Speed index 1345
x#^2 - y#^2 : Speed index 224
x#*x# - y#*y#: Speed index 1345
(x#+y#)*(x#-y#): Speed index 1345
Needless to say I have adapted all my progs... My old Screen 12 Mandelbrot Explorer draws the first pic (300x300) in 5 seconds now, instead of 27 seconds last year ! And the SVGA version I issued last month is, at least, confortable...
Sattamassagana, SCM !