Replies: 14 comments 25 replies
-
Note: We believe there is a typo in the caption of Figure 1; it should say "100 |
Beta Was this translation helpful? Give feedback.
-
As a hardware person, I see lots of similarities between tracing-based dynamic compilers and hardware acceleration: both identify hot spots in the program and optimize (specialize) them. While this paper focus on leveraging run-time type information to optimize a trace into specialized machine codes, I wonder if any compiler could also make use of the structure of the CFG of the trace? For example, many linear algebra operations naturally incur nested loops (Figure 7 in the paper could come from a matrix-vector multiplication where the branch in the inner loop handles overflows). The compiler could detect such structure and map a large portion of the trace to especially optimized libraries. |
Beta Was this translation helpful? Give feedback.
-
While searching around for any more concrete specification of Mozilla Javascript Ion LIR (lower level than MIR) which seems to be related to the trace-flavored SSA LIR described on page 468 in which the paper's traces are recorded, I came across an interesting retrospective from 2011 regarding the costs and benefits of implementing and supporting tracing for Javascript JIT compilation as progress marched on. |
Beta Was this translation helpful? Give feedback.
-
I wonder whether it's against Python's philosophy to have an opt-in feature that use their type hints feature to make trace optimizations. Currently type hints are used for static analysis with tools such as mypy. Maybe the CPython compiler can benefit from these types, given that the type check passes. |
Beta Was this translation helpful? Give feedback.
-
I drew a lot of parallels between this paper and the current assignment we're working on; I found many of the ideas that this paper presents to be quite compelling; the idea of blacklisting a section of the program for which tracing often aborts is quite an interesting one as well. All this primarily goes to show that even without explicit static type information, the use of dynamic compilation can still enable speedups to be made upon execution. |
Beta Was this translation helpful? Give feedback.
-
I was surprised by how many heuristics the authors needed to add in order make the dynamic compiler behave more predictably:
The paper was a good way to learn how dynamic compiler implementations diverge from the theory, without having to go through the great effort of creating such a compiler. All these ad-hoc fixes make me wonder if it makes sense to research a uniform approach to dynamic compilation for all programming languages. |
Beta Was this translation helpful? Give feedback.
-
Super interesting paper, especially since up to now (including 4120), we've primarily only discussed statically typed languages. Something I found odd was that there are an absurd number of optimizations for these dynamically typed languages that are all extremely complicated (and probably intractable without heuristics/approximations). I wonder if the benefits of dynamically typed languages (their ease of use) really merits this amount of work to achieve what I would assume to be outperformed by a statically typed language with a well-written compiler. I feel like a good compromise would just to have a good type inference system (with type hints) to avoid all of this... |
Beta Was this translation helpful? Give feedback.
-
I really enjoyed this paper! Dynamically compiled languages are pretty complicated to implement, but this paper did a good job breaking down the main methods. I'm most curious about where the future work of this paper went actually. It's been a long time since it came out and we've had a lot of advancements in hardware acceleration and language development among other things. Is this tracing interpreter used in industry, or did people find better ways to implement JavaScript (I guess better means more performant here). Like Andy said above, the optimizations for languages like JavaScript get pretty complex, and one can argue that it's not worth trying to optimize the heck out of a language that is not meant to be running in super high-performance settings. Some people above also talked about opt-in optimizations, which is also interesting food for thought. |
Beta Was this translation helpful? Give feedback.
-
The paper helped clear up some confusion I had on the topic and in this week's assignments. I was surprised to see that many of the benchmarks were running almost entirely in native code, despite being written in a dynamic language. I liked that the authors constructed a trace tree that tracks not only hot loops but also hot exits, which helps the compiler covers more hotspots and deal with loops of arbitrary depths. Some other thoughts I had:
|
Beta Was this translation helpful? Give feedback.
-
This was super interesting! I had a couple questions/thoughts:
|
Beta Was this translation helpful? Give feedback.
-
I wonder if the nested tree idea can be used to solve the recursion problem in the paper. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
The paper mentions that traditional static type inference is way too expensive for the highly interactive environment of a web browser. Echoing Zach's point above, their test suite does not seem to be representing this highy interactive environment. Moreover, I am a bit confused as to why static type inference is not suitable. If we could guess most of the types that can show up on runtime, all we have to do is to pay a one-time heavy price of static type inference for all possibilities, and then use it alongside some jitting techniques to execute the appropriate piece of code when types are finally revealed at runtime. Since the cost is one-time only, this could potentially be plausible. It would be great to see some explanation about this in the paper. |
Beta Was this translation helpful? Give feedback.
-
Here's the PR for our blog post: #416 |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! The discussion on 11/7 is about JIT via tracing. The reading can be found here.
Beta Was this translation helpful? Give feedback.
All reactions