i couldn't make the inlining via define-syntax-rule work in typed racket. in 
normal racket define-inline did'nt speed things up much but changing the code 
of "acht-teiler" to:
CODE--
(define-syntax-rule (acht-teiler n)
  (let loop ((i 2) (count 0) (quadrat 4) (steigung 5))
    (cond ((= quadrat n) #f)
          ((> quadrat n) (unsafe-fx= count 3))
          ((unsafe-fx= (unsafe-fxmodulo n i) 0) (loop (unsafe-fx+ i 1) 
(unsafe-fx+ count 1) (unsafe-fx+ quadrat steigung) (unsafe-fx+ steigung 2)))
          (else (loop (unsafe-fx+ 1 i) count (unsafe-fx+ quadrat steigung) 
(unsafe-fx+ steigung 2)))))
  (loop 2 0 4 5)
  )
--CODE
that is: no inner define but  a let brought the same speed up as using 
typed-racket

is let in general faster than define?


@ gneuner2
jitting the function with a previous call yields only slightly better results 
(on my mashine in the range of milliseconds)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to