On 7/1/2017 9:07 AM, 'Shakin Billy' via Racket Users wrote:
java code runs in 4.5 seconds
racket code takes 12.5 seconds to complete (in cli-mode)

Just a thought ... did you compile the Racket code before you ran it? If not, it's likely quite a bit of the Racket time was for compilation.

see *raco make* and *raco exe* in the docs
https://docs.racket-lang.org/search/index.html?q=raco

i typed racket and used unsafe operations. some perfomance hints from the guide 
don't seem to apply since i already typed racket.  the optimization coach hints 
to use define-inline but it seems to be available only in non-typed-raket.

what can i do to speed things up (except better algorithms?)

I haven't analyzed your code, but at a glance using executors makes the Java code multi-threaded whereas the Racket code is only single threaded. It would be more fair to compare like implementations.

Racket has no exact analog of Java threads. Racket threads are "user space" (aka "green") and are multitasked on a single cpu or core. Racket also has "places" which are separate instances of the runtime. Places can operate simultaneously on multi-cpus/cores but (for the most part) they do not share any memory - they are an implementation of Hoare's CSP (communicating sequential processes).

https://docs.racket-lang.org/reference/concurrency.html


George

--
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