help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: State of JIT compiler


From: Luke M
Subject: Re: State of JIT compiler
Date: Tue, 22 Feb 2011 14:47:44 -0800 (PST)


leledumbo wrote:
> 
> Has someone already worked on it? I'm kinda interested in this, since this
> is a real show stopper for advanced MATLAB users. I have previous
> experience with LLVM (not much, only a standard procedural language
> implementation) and searching on this list about JIT often linked to LLVM.

I agree with Jordi: I expect advanced Matlab users to be well familiar with
vectorization and various speed-related tricks.  However, I do agree that
JIT would be a huge boon to Octave adoption, and every few months I get
really interested in it.  If you do a search on the threads you get lots of
info:

http://www.google.com/search?q=octave+jit+site%3Anabble.com

Almost all of the previous discussion has been focused on going the LLVM
route; that is, tackling the monster that is static type inference. 
However, a couple of the threads touch on a newer method without actually
giving the name: tracing JIT (or trace-based JIT).  As far as I understand
it, the idea is to allow the interpreter to run as normal until it finds a
block of code that is run multiple times on the same path, compiling that
chunk, and using that to speed up execution.  When it exits the block --
whether it's the end of the loop or just a conditional jump that doesn't
usually occur -- it goes back to the interpreter.  No type inference would
be needed because the interpreter would *tell* the compiler what the types
are.

http://morepypy.blogspot.com/2009/03/applying-tracing-jit-to-interpreter.html
http://article.gmane.org/gmane.comp.lang.lua.general/44781
http://scholar.google.com/scholar?q=Trace-based+Compiler

Unfortunately, I'm not smart enough (yet) to see the issues or attempt to
translate these ideas into code.  Someone smarter than me about Octave
internals has said that the tree walker in Octave should be rewritten in
order to provide the ability to profile code, which should also help with
any efforts to implement JIT.

Additionally, perhaps we can ask the McLab folks at McGill University for
their source code to see how they are doing type inference.  Their site says
the source code will be BSD licensed and is available upon request:

http://www.sable.mcgill.ca/mclab/
http://scholar.google.com/scholar?q=McLab+matlab
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/State-of-JIT-compiler-tp3319772p3320204.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]