<br><br><div class="gmail_quote">On Sun, Oct 16, 2011 at 11:50 AM, Maciej Fijalkowski <span dir="ltr"><<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Sun, Oct 16, 2011 at 2:29 PM, Stefan Behnel <<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>> wrote<br>
<div class="im">> Samuel Vaiter, 14.10.2011 17:59:<br>
>><br>
>> The main<br>
>> reason why Numpy is my main interest is that as Ph.D student in<br>
>> Applied Mathematics, I really hope one day we will be able to perform<br>
>> numerical computation without using heavy binding in C/Fortran or<br>
>> intermediate solution like Cython.<br>
><br>
> I guess you didn't mean it that way, but "intermediate solution" makes it<br>
> sound like you expect any of these to go away one day. They sure won't.<br>
> Manually optimised C and Fortran code will always beat JIT compilers,<br>
> especially in numerics. It's a game they can't win - whenever JIT compilers<br>
> get too close to hand optimised code, someone will come along and write<br>
> better code.<br>
><br>
> Stefan<br>
<br>
</div>I guess what you say is at best [citation needed]. We have proven<br>
already that we can perform several optimizations that are very hard<br>
to perform at the C level. And indeed, while you can always argue<br>
"well, you can just write a better compiler", it's true also for JITs.<br>
And we're only at the beginning of what we can do.<br>
<br>
One example that I have in mind is array expressions that depend on<br>
runtime - we can optimize them fairly well in the JIT (which means SSE<br>
and whatnot), but you just can't get the same thing in C, because<br>
you're unable to compile native code per a set of array operations.<br>
<br>
Cheers,<br>
fijal<br>
<div><div></div><div class="h5">_______________________________________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org">pypy-dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">http://mail.python.org/mailman/listinfo/pypy-dev</a><br>
</div></div></blockquote></div><br>Another example, which no fortran compiler will ever be able to do, is if you create a ufunc from a Python function, you can still inline it into assembler that's emitted for an operation so:<div>
<br></div><div>a + b * sin(my_ufunc(c))</div><div><br></div><div>still generates a single loop in assembler.</div><div><br></div><div>Alex<br clear="all"><div><br></div>-- <br>"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)<br>
"The people's good is the highest law." -- Cicero<br><br>
</div>