Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-12 Thread Colin Fleming
Sure, absolutely - there's nothing like profiling to see what's actually going on and his recommendation seems sound either way, I just thought the information was interesting. On 11 August 2015 at 23:44, Zach Tellman wrote: > It's fluid, but the output that Norman uses in his post (and that > m

Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-11 Thread Alex Miller
There's code splits like that in Clojure's RT.java too - things like seq() and seqFrom() have the same intention. We have run into cases where we blew the inlining budget and performance was affected. -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-11 Thread Zach Tellman
It's fluid, but the output that Norman uses in his post (and that motivated the changes to Aleph) were from the JVM explicitly saying "I would have inlined this, but it was too big". That may not be true under other circumstances, but you're only helping by factoring out uncommon, large code b

Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-11 Thread Colin Fleming
That's a really interesting post, thanks for that. I actually cornered Cliff Click at Curry On because I was interested in knowing how well the JVM inlined var indirection. The short answer is "it's complicated". But if the JVM does inline your method, then the var indirection shouldn't cost you as

Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-11 Thread Zach Tellman
The inlining part is explained very well by this blog post http://normanmaurer.me/blog/2014/05/15/Inline-all-the-Things/ As for why I left all the repetition in there, I tend to let code expand before getting annoyed and compacting it. Sometimes there's a commit between those two events, somet

Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-09 Thread Lawrence Krubner
Reid, thank you. I think you answer half the question. You make a good point about giving the JVM a way to better optimize a hot path. I think you are right about that. But, given the large amount of repetition between "chain'-" and "chain-" I'm wondering why this wasn't done with a macro?

Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-08 Thread Reid McKenzie
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Lawrence, This is just a theory, but in the interests of response time, the JVM uses a large number of heuristics to determine what optimizations will likely prove profitable. One of them is a budget for method size. I would guess that lifting this

What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-08 Thread Lawrence Krubner
I'm always interested in anything Zach Tellman does, though I don't always understand it. I see that he defines a function twice, via (let), of which he says "factored out for greater inlining joy". Does anyone know what he means by that? Can anyone suggest a reason why this was more conveni