Gregory Ewing writes:
> A JIT compiler works by observing the actual values
To be pedantic, that's called a "tracing JIT". Other runtime code
generation is also frequently called JIT compilation even when it's
fairly stupid combining of assembly code templates, or the like.
--
https://mail.pyth
Steve D'Aprano wrote:
You seem to be describing a *tracing JIT* compiler.
Well, yes, but it seems to me that a JIT compiler that
*doesn't* use tracing is just an AOT compiler that you
happen to run immediately before executing the program.
Cython doesn't do any of that -- it's just a plain,
On Tue, 18 Apr 2017 03:43 pm, Gregory Ewing wrote:
> Steve D'Aprano wrote:
>> I'm not sure why the Cython devs maintain this is not a JIT compiler.
>> Perhaps I misunderstand something.
>
> A JIT compiler works by observing the actual values taken on
> by variables at run time, and if it notices
Steve D'Aprano wrote:
I'm not sure why the Cython devs maintain this is not a JIT compiler.
Perhaps I misunderstand something.
A JIT compiler works by observing the actual values taken on
by variables at run time, and if it notices that a particular
variable seems to always have a particular ty
On Mon, 17 Apr 2017 08:52 pm, Steve D'Aprano wrote:
> but research does continue into using gradual typing for optimizations:
>
> http://dl.acm.org/citation.cfm?id=2069175
Another interesting research project into speeding up Jython using type
hints:
http://scholar.colorado.edu/ecen_gradetds/57
Steve D'Aprano writes:
> On the other hand, there's Cython. Cython claims *not* to be a JIT compiler,
One of the uses of "JIT compiler" these days is what's sometimes called
a tracing JIT, like PyPy or LuaJIT or the Javascript flavor-of-the-week.
That means it interprets the program while collect
On Mon, 17 Apr 2017 04:18 pm, Paul Rubin wrote:
> Steve D'Aprano writes:
>> Since it is *optional*, it is only a hint, not a fact. You can tell the
>> compiler that you believe that n will be an int, but it's not guaranteed.
>
> The runtime could check at the entry to the function that n is an i
On Sun, 16 Apr 2017 02:27 pm, Steve D'Aprano wrote:
> Are you aware that optional static typing CANNOT be used for optimization?
I think I've over-stated that. Considerably. In other words, I was wrong.
As Steve Yegge points out, dynamic languages like Smalltalk and Lisp were,
back in the 1980s,
Steve D'Aprano writes:
> Since it is *optional*, it is only a hint, not a fact. You can tell the
> compiler that you believe that n will be an int, but it's not guaranteed.
The runtime could check at the entry to the function that n is an int,
and then it wouldn't have to keep re-checking on the
On Mon, 17 Apr 2017 05:16 am, bartc wrote:
> But it was OK for Steve to 'win' the benchmark by substituting my test
> code with something only vaguely related, and much simpler?
Okay, you're now being obnoxious, and telling lies about me.
What I said was
"FOR WHAT IT'S WORTH [emphasis added],
On Mon, Apr 17, 2017 at 5:16 AM, bartc wrote:
> On 16/04/2017 20:00, Chris Angelico wrote:
>>
>> On Mon, Apr 17, 2017 at 4:43 AM, bartc wrote:
>
>
>> Sure! If all you care about is winning benchmarks,
>
>
> The benchmarks should be about comparing things. But they have to be like
> for like.
You
On 16/04/2017 20:00, Chris Angelico wrote:
On Mon, Apr 17, 2017 at 4:43 AM, bartc wrote:
Sure! If all you care about is winning benchmarks,
The benchmarks should be about comparing things. But they have to be
like for like.
Since this was about the effects of type annotations, it would b
On Mon, Apr 17, 2017 at 4:43 AM, bartc wrote:
>>
>> For what it's worth, on my machine (2GB RAM and 1.2GHz CPU) I can add up
>> 100
>> million ints in 14 seconds:
>>
>> py> with Stopwatch():
>> ... sum(range(1))
>> ...
>> 49995000
>> time taken: 14.032116 seconds
>
>
> I'm surp
On 16/04/2017 18:13, Steve D'Aprano wrote:
On Mon, 17 Apr 2017 02:20 am, justin walters wrote:
On Sun, Apr 16, 2017 at 8:46 AM, bartc wrote:
What were the results with Python on your machine?
Well, at first I tried to implement it with a generator. I gave up on
waiting for the program to
On Mon, 17 Apr 2017 02:20 am, justin walters wrote:
> On Sun, Apr 16, 2017 at 8:46 AM, bartc wrote:
>
>> What were the results with Python on your machine?
>
>
>
> Well, at first I tried to implement it with a generator. I gave up on
> waiting for the program to complete
> after about 6 minut
On Sun, Apr 16, 2017 at 8:46 AM, bartc wrote:
> What were the results with Python on your machine?
Well, at first I tried to implement it with a generator. I gave up on
waiting for the program to complete
after about 6 minutes.
After using your code almost exactly I get:
>>> Sum: 1499850
On 16/04/2017 16:00, justin walters wrote:
On Sun, Apr 16, 2017 at 3:55 AM, bartc wrote:
Example C of the same silly program in Python:
def add(a,b):
return a+b
def testfn():
sum=a=b=0
for i in range(1):
sum += add(a,b)
a += 1
b += 2
print (a,
On Sun, Apr 16, 2017 at 3:55 AM, bartc wrote:
> Example C of the same silly program in Python:
>
> def add(a,b):
> return a+b
>
> def testfn():
> sum=a=b=0
> for i in range(1):
> sum += add(a,b)
> a += 1
> b += 2
>
> print (a,b,sum)
>
> testfn()
>
>
On Sun, Apr 16, 2017 at 8:55 PM, bartc wrote:
> On 16/04/2017 05:27, Steve D'Aprano wrote:
>>
>> On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
>>
>>> apparently, the py-devs believe we
>>> only deserve type declarations that do nothing to speed up
>>> code execution (aka: type-hints), instead
On 16/04/2017 05:27, Steve D'Aprano wrote:
On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
apparently, the py-devs believe we
only deserve type declarations that do nothing to speed up
code execution (aka: type-hints), instead of type
declarations that could actually speed up the code. Go
fig
On Sun, 16 Apr 2017 09:48:15 +, alister wrote:
> On Sun, 16 Apr 2017 14:27:28 +1000, Steve D'Aprano wrote:
>
>> On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
>>
>>> apparently, the py-devs believe we only deserve type declarations that
>>> do nothing to speed up code execution (aka: type
On Sun, 16 Apr 2017 14:27:28 +1000, Steve D'Aprano wrote:
> On Sat, 15 Apr 2017 11:55 am, Rick Johnson wrote:
>
>> apparently, the py-devs believe we only deserve type declarations that
>> do nothing to speed up code execution (aka: type-hints), instead of
>> type declarations that could actually
22 matches
Mail list logo