Replies: 11 comments 15 replies
-
This paper felt like the tracing JIT counterpart to the SELF paper we read last week. Rather than do type specialization per function as in the method JIT used to implement SELF, this paper does type specialization for a JavaScript tracing JIT. Therefore, it's surprising that this paper came out 20 years after the SELF paper. I wonder if there's a reason why type specialization for tracing JITs took a lot longer to develop. Is it more challenging to actually see the benefit of type specialization in tracing JITs than method JITs? Or were tracing JITs as a whole developed much later than method JITs? I also found the section on blacklisting quite interesting. I think it's particularly telling that the authors chose not to support arbitrary exceptions at all in JavaScript. It makes sense to me that supporting arbitrary exceptions in a tracing JIT would be challenging and blacklisting these paths is an interesting solution to reduce the overhead of tracing in a tracing JIT. I wonder how challenging it would be to support arbitrary exceptions? Is it just a matter of implementation difficultly or is there a significant performance impact from supporting these exceptions (requiring some backup of the state before throwing an exception)? |
Beta Was this translation helpful? Give feedback.
-
This paper was interesting to read because of the detailed discussions on the challenges of implementing a tracing JIT. One would think that just adding type assumptions to a block of code and compiling it would be enough but it turns out to be much more nuanced than that (nested loops, exceptions, preemptions, FFI, etc.) The FFI aspect was extremely interesting especially because of the possibility of the FFI functions calling back into the interpreter. I wonder if newer VMs handle that any better than to just give up and not trace any blocks that use FFI. |
Beta Was this translation helpful? Give feedback.
-
Reading that triggered me to search more about the evolution of JIT compilers in web browsers (Firefox specifically). While in this paper the authors point-out that TraceMonkey achieves better performance than method-base JITs because it operates on the granularity of the loops, it looks like it was later replaced by a JIT that combines elements of both strategies (JägerMonkey). It looks like that there are some issues related to trace-based JIT. Specifically, some info from this article on why the replaced TraceMonkey with JägerMonkey:
The full article can be found here: https://hacks.mozilla.org/2010/03/improving-javascript-performance-with-jagermonkey/ |
Beta Was this translation helpful? Give feedback.
-
My most burning question is basically just gossip: what is it like to write a paper with fifteen others? I wonder if Adrian has any historical context about the group that developed TraceMonkey and its successors. Often in this course we've looked at a paper and then wondered wistfully what the authors went on to do with the project. That question is relatively easy to answer in this case; see here and here. I found it interesting that they built upon TraceMonkey by going back to a method-level JIT compilation. Quote below is from the second link. Thoughts?
|
Beta Was this translation helpful? Give feedback.
-
I found it interesting how this paper builds on the idea of using type specialization, used in Self, and applies it to loop traces. I agree with the authors assumptions that loops are the most executed parts of the programs, which makes type specialization useful, but I was also curious if type specialization could be used in other places such as memory allocation. For instance, I was thinking that if you knew what types objects were on a certain trace, then you could allocate those objects using minimal amounts of memory, rather than having to allocate larger chunks of memory if you did not know the exact type of the object, and had to allocate generically. I was also curious why bitops-3bit-bits-in-byte and bitops-bitwise-and perform so much better than the V8 and SFX jit compilers. The performances on these 2 programs seem much better than usual, and it would be interesting if the performance could be explained, similar to how the authors explain why some of the benchmarks act the way they do. Otherwise, I do feel that these 2 benchmarks performances indicate the realm of improvement possible, even without other techniques used in the V8 and SFX compilers like call threading. |
Beta Was this translation helpful? Give feedback.
-
I thought the solution to the nested loop problem was particularly cool. I thought the solution to the nested loop problem was particularly important to the success of the idea of a tracing JIT. The tracing here leads to the compilation of hot loops. I wonder whether there are any other particularity useful "hot" things compilers could choose to compile as well. For example, consider a call to a logger, |
Beta Was this translation helpful? Give feedback.
-
I would say this paper is more readable than the previous OOPSLA papers (probably because I am not a big fan of those long and old-fashion things). It uses type information to specialize different traces and compile the traces in a hierarchical way, which is able to tackle complex nested loops. The key idea is rather intuitive and easy to understand. I at first thought it would be easy to implement, but the authors told us there were lots of details to be considered, including tacking exceptions, blacklisting with nesting, calling external functions, etc. They finally resolved those issues systematically and made a workable and efficient implementation for JavaScript. My question is also similar: These techniques seem not that novel and perhaps should be invented in the last century when the tracing-based JIT compiler was first invented, but why the paper was published so late in 2009. Was it the first to propose this kind of type-specialized trace-based JIT technique? Also, it mentions multicore compilation would speedup the compilation process but would be left for their future work. Hasn't the multicore hardware been prevalent at that time? I think running two processes for runtime and JIT compiler concurrently should not be a big challenge? |
Beta Was this translation helpful? Give feedback.
-
First of all, what is this cursed amalgam of intel and at&t syntax for x86 in fig 3... I would definitely agree w/ the above comments that this paper was a lot more readable than the SELF one, which was nice. One of the most interesting things to me in this paper was how they managed to have a tracing JIT that ended up with more compiled code than just simple traces, with the "trace trees." This left me wondering what other structures can be compiled like this? It seems that in this case they take advantage of the lack of merge points giving them an SSA without φ functions, but are there ways around this? |
Beta Was this translation helpful? Give feedback.
-
This paper was an interesting read and a nice introduction to the more nitty-gritty aspects of tracing. I'm curious as to what future work (if any) was done to address the overhead due to short, nested loops, as this seems like a fairly common occurrence in the benchmarks. What exactly causes the additional overhead in these loops, and can this be addressed by somehow inlining the inner loop to the outer method trace? (The paper mentions a large overhead associated with compiling multiple versions of an outer loop for each inner loop trace, but it seems unlikely that the types of variables used in inner loops would change a lot over the course of executing the outer loop). Edit: I realize that if we were to trace every execution of the inner loop and outer loop, we would have just as many possible combinations if we started with the outer loop or the inner loop, but perhaps we could get away with only keeping track of a small fraction of these possible executions (e.g. the last two traces of the outer loop, inlining the most common traces of the inner loop). |
Beta Was this translation helpful? Give feedback.
-
The heuristic of marking a loop path as hot when the minotaur comes across its backedge at least twice seems reasonable enough but it's still a little arbitrary. I guess in order to keep the JIT's optimization capabilities general it's very difficult to make up a good criterion for hot paths that makes sense for all programs. However I wonder how advantageous it is to extend the program with optional annotations on |
Beta Was this translation helpful? Give feedback.
-
This paper was an interesting read because I had never really thought about how much slower compiled code might be for dynamically typed languages. So I was pleasantly surprised to see speedups of around 2-20x on many benchmarks with TraceMonkey. On a very unrelated note, something I’m learning this semester is that loops can be a great target for optimizations in so many ways. TraceMonkey finds hot paths in loops and executes these type-specialized traces, resulting in massive speedup- this sort of reminded me of a runtime verification paper I read recently that showed how you can transform loops in order to only monitor events produced from the first few iterations, which results in a large overhead reduction! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is the link for the paper
Beta Was this translation helpful? Give feedback.
All reactions