On Wed, 5 Aug 2020 08:21:07 -0700 (PDT), "wanp...@gmail.com" <wanpee...@gmail.com> wrote:
>I was working on a exercism problem named Raindrops. > > : > >I thought version 1 would be faster, but it turned out to be wrong. Running >with raco test got following timing information. > >version 1 >cpu time: 9 real time: 9 gc time: 9 >version 2 >cpu time: 0 real time: 0 gc time: 0 > >Then I ran both version in DrRacket, both output following result. >cpu time: 0 real time: 0 gc time: 0 > >It's strange, isn't it? It looks like the time for the 1st version was skewed by a garbage collection during execution. Generally for a decent benchmark, you need to run the code many times and average the results. For Racket, additionally you need to *exclude* the time for the 1st run because that will include time for JIT compilation. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/csmnifpho2kgr9sme0psdd0729ui9isdhb%404ax.com.