At Fri, 31 Jul 2015 15:03:53 +0100, Laurent wrote:
> I don't really understand why `in-range` makes such a difference. It looks
> like the kind of sequence iterator is tested at each step, whereas I was
> expecting it to be tested only at the beginning of the loop, since this
> sequence iterator kind can't change from one iteration to the next, right?
> 
> Hence, I was expecting the `in-range` (and actually all other `in-*`) issue
> to appear only inside nested loops, where some loops are started many times
> (thus requiring many iterator kind tests).

Right: The `in-*` functions tell `for` what kind of step operations to
inline into the loop (after an initial guard that confirms that it has
a number, list, etc., to iterate through). Otherwise, there's a
run-time dispatch to take each step, which is usually more significant
than a run-time dispatch to set up the loop.


At Fri, 31 Jul 2015 16:41:51 +0100, Laurent wrote:
> My question still holds though: Can I expect the JIT to optimize the cases
> of my primary concern? (Or are these cases unlikely to be a bottleneck?)
> I'm unsure about how to set up correct stress tests as the JIT does a good
> job at optimizing a number of things and then I'm not sure what precisely
> I'm measuring.

I think you should expect optimization in cases like this, but you'll
be disappointed sometimes. All optimizations are hueristics, and
heuristics for inlining (the relevant optimization here) are especially
tricky. I think the v6.2 difference is probably a result of Gustavo's
refinements to the heuristics for inlining.

The Optimization Coach helps you with one reliable strategy for dealing
with the optimizer, which is to compile some code and see what the
optimizer does.

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