[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Geiser-users] interesting behavior of Racket's (ti me-apply …) with

From: Jose A. Ortega Ruiz
Subject: Re: [Geiser-users] interesting behavior of Racket's (ti me-apply …) with Geiser
Date: Thu, 03 Oct 2013 23:59:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)


On Thu, Oct 03 2013, Vlad Kozin wrote:

> Hi. I'm just copy-pasting from the letter I wrote to the Racket list.
> Just a bunch of reverse-string solutions. Try running
> test-reverse-string.rkt in you Geiser repl if you want to replicate.
>     Mostly a question to Jay McCarthy but I suppose could be
>     interesting to others. Was going over his Reversing strings
>     article. Somehow I get weird performance. Slowest solution turns
>     out fastest, medium, fast and really fast are only marginally
>     different.
>     Could anyone have a look
>     reverse-string.rkt has the solutions
>     test-reverse-string.rkt does the performance check
>     Testing it on 40'000 randomly generated strings 1000 chars each.
>     Oh, wow. So I was testing this in Geiser repl in emacs:
>     (2467 4631 4088 3934) Where apparently "slower" one wins
>     But in DrRacket the result looks plausible:
>     (8994 1859 1094 865)
>     Does that mean Geiser shouldn't be trusted?
> Restarting the repl and running from the clean slate doesn't
> help. Shows plausible results in DrRacket and correct results when run
> in command line.

Geiser disables module compilation constants, to allow redefinitions.
That means that the JIT compiler doesn't perfom optimizations and
that might well be influencing timings.

Check the first chapter of the documentation for an explanation of why
we do that in Geiser, and the REPL chapter for a pointer to why that
might not be a good idea according to, among others, some of Racket's
creators! I disagree with them, but that's just me :)

The root of all superstition is that men observe when a thing hits,
but not when it misses.
  -Francis Bacon, essayist, philosopher, and statesman (1561-1626)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]