bf program benchmark

47 views
Skip to first unread message

sleepnova

unread,
Nov 4, 2020, 4:40:39 AM11/4/20
to Racket Users
I'm benchmarking the bf language implementation[1] take from Beautiful Racket with mandelbrot.bf example[2].

I slightly modified the expander to gain performance.[3]

And it took about 72s to finish.

Then I try to benchmark the same program in a Java implementation which I implemented years ago. A simple bf runner simply translate bf program to JVM byte-code and run.

It took about 27s.

Is there any way to improve the performance of the Racket implementation to make it close to Java one? Any tip and trick to help the Racket VM generate more efficient code?
[4] https://code.google.com/archive/p/bfj/

--
- sleepnova
Founder of FindTaxi

Sorawee Porncharoenwase

unread,
Nov 4, 2020, 4:50:29 AM11/4/20
to sleepnova, Racket Users

You might want to take a look at Danny’s original bf article, which includes optimizations. By the end of the article, he reduces the running time of one benchmark program from “thirty-seven seconds to just over one”.


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CABa2-7OFLh8YUfXvTNFe%2BmJ%3Dyb5rw0hB2KU8_ojCjVmvVbEQ7A%40mail.gmail.com.

sleepnova

unread,
Nov 5, 2020, 4:50:44 AM11/5/20
to Sorawee Porncharoenwase, Racket Users
Thanks for sharing this article. After applying the "all macro" optimization[1], the execution time reduce to 22s, which beats the Java one!
The modified version is here[2].

If anyone knows any optimization opportunities, please let me know.
I would like to optimize further if possible!


Sorawee Porncharoenwase <sorawe...@gmail.com> 於 2020年11月4日 週三 下午5:50寫道:

sleepnova

unread,
Nov 5, 2020, 6:08:07 AM11/5/20
to Racket Users
BTW, I thought Racket CS could run faster, but it is not. It took 32s to finish.
Reply all
Reply to author
Forward
0 new messages