[racket] Performance. Higher-order function

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Aug 3 19:51:56 EDT 2014

On Aug 3, 2014, at 6:29 PM, Richard Cleis wrote:

> If I (define i->c integer->char), and use it in your test1, it becomes the slowest.
> That might mean that the "unknown function" response from Dr F applies to your function, too.
> In other words, I think this is another example of drawing ambiguous conclusions from tests that are too simple.
> I gave up on benchmarks long ago, because there are too many people outsmarting too many other people. 
> 
> Interesting, though (uh oh, I am getting sucked in): 
> In v5.3.1 all of your tests are the same speed.
> I even added some tests that use 'currying' to perhaps prevent the conversion function from being "inspected" on every call, and those are the same speed, too.
> 
> So it seems that the outsmarting peeps who wrote v6.1 optimized your first test, somehow, to make it twice as fast when it uses a "known function".


One major change in 6.1 is that local define no longer sets a function to "undefined" but instead uses a run-time check to catch bad uses. 

Dybvig reported a long time ago that this could enable more flow-style optimizations because the compiler no longer needs to split values (check for undefined). 

Enough about micro benchmarks, which really reveal little -- Matthias


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140803/f0c2fd04/attachment.html>

Posted on the users mailing list.