{"id":9119,"date":"2025-02-28T18:36:36","date_gmt":"2025-02-28T17:36:36","guid":{"rendered":"https:\/\/wsj-crypto.com\/?p=9119"},"modified":"2025-02-28T18:36:36","modified_gmt":"2025-02-28T17:36:36","slug":"unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency","status":"publish","type":"post","link":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/","title":{"rendered":"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency"},"content":{"rendered":"<p><\/p>\n<div id=\"\">\n<p class=\"chakra-text css-gi02ar\">The Ethereum Virtual machine stands out as somewhat unique compared to the majority of other Virtual Machines available. In my\u00a0<!-- --><a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-ug8vf0\" href=\"https:\/\/medium.com\/@jeff.ethereum\/optimising-the-ethereum-virtual-machine-58457e61ca15\">earlier article<!-- --><\/a>\u00a0I elaborated on its usage and highlighted several of its features.<!-- --><\/p>\n<p><!-- --><\/p>\n<blockquote class=\"chakra-code css-1cl98my\"><p>The Ethereum Virtual Machine (EVM) is a basic yet potent, Turing complete 256-bit Virtual Machine that permits anyone to run arbitrary\u00a0<!-- --><a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-ug8vf0\" href=\"https:\/\/github.com\/ethereum\/go-ethereum\/blob\/master\/core\/vm\/opcodes.go\">EVM Byte Code<!-- --><\/a>.<!-- --><\/p><\/blockquote>\n<p>The go-ethereum initiative includes two versions of the EVM. A straightforward and uncomplicated\u00a0<!-- --><a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-ug8vf0\" href=\"https:\/\/en.wikipedia.org\/wiki\/Bytecode\">byte-code VM<!-- --><\/a>\u00a0and a more advanced\u00a0<!-- --><a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-ug8vf0\" href=\"https:\/\/en.wikipedia.org\/wiki\/Just-in-time_compilation\">JIT-VM<!-- --><\/a>. In this article, I will clarify some distinctions between these two versions while discussing certain attributes of the JIT EVM and the reasons it can be significantly faster than the byte-code EVM.<br \/>\n<!-- --><br \/>\n<!-- --><\/p>\n<h3 class=\"chakra-heading css-145upk7\" id=\"c1d8\">Byte Code Virtual Machine of Go-ethereum<!-- --><\/h3>\n<p>The internal workings of the EVM are rather straightforward; it consists of a singular run loop that endeavors to carry out the instruction located at the current\u00a0<!-- --><em class=\"chakra-text css-0\">Program Counter (PC<!-- --><\/em>\u00a0for short). Within this loop, the\u00a0<!-- --><em class=\"chakra-text css-0\">Gas<!-- --><\/em>\u00a0is computed for each instruction, memory is augmented if needed, and the instruction is executed if the preliminary conditions are met. This process continues until the VM either concludes successfully or returns an error by triggering an exception (e.g.\u00a0<!-- --><em class=\"chakra-text css-0\">out-of-gas<!-- --><\/em>).<br \/>\n<!-- --><\/p>\n<div class=\"chakra-stack css-1uyok63\">\n<pre><pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span class=\"token\" style=\"color:rgb(127, 219, 202)\">for<!-- --><\/span><span> <!-- --><\/span><span class=\"token\" style=\"color:rgb(130, 170, 255)\">op<!-- --><\/span><span> <!-- --><\/span><span class=\"token\" style=\"color:rgb(127, 219, 202)\">=<!-- --><\/span><span> contract<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">[<!-- --><\/span><span>pc<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">]<!-- --><\/span><span> <!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">{<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>    <!-- --><\/span><span class=\"token\" style=\"color:rgb(127, 219, 202)\">if<!-- --><\/span><span> <!-- --><\/span><span class=\"token\" style=\"color:rgb(127, 219, 202)\">!<!-- --><\/span><span>sufficientGas<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">(<!-- --><\/span><span>op<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">)<!-- --><\/span><span> <!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">{<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>        <!-- --><\/span><span class=\"token\" style=\"color:rgb(255, 203, 139)\">return<!-- --><\/span><span> error<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">(<!-- --><\/span><span class=\"token\" style=\"color:rgb(173, 219, 103)\">\"not enough gas for op:\"<!-- --><\/span><span>, or<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">)<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>    <!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">}<!-- --><\/span><span>\n<!-- --><\/span><\/code><\/pre>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>    switch <!-- --><\/span><span class=\"token\" style=\"color:rgb(130, 170, 255)\">op<!-- --><\/span><span> <!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">{<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>    <!-- --><\/span><span class=\"token\" style=\"color:rgb(127, 219, 202)\">case<!-- --><\/span><span> <!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">..<!-- --><\/span><span>.:<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>        \/* execute *\/<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>    <!-- --><\/span><span class=\"token\" style=\"color:rgb(127, 219, 202)\">case<!-- --><\/span><span> RETURN:<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>        <!-- --><\/span><span class=\"token\" style=\"color:rgb(255, 203, 139)\">return<!-- --><\/span><span> memory<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">[<!-- --><\/span><span>stack<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">[<!-- --><\/span><span>-1<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">]<!-- --><\/span><span>, stack<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">[<!-- --><\/span><span>-2<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">]<!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">]<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>    <!-- --><\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">}<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>    pc++<!-- --><\/span><\/code><\/pre>\n<p><!-- --><\/p>\n<pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span class=\"token\" style=\"color:rgb(199, 146, 234)\">}<!-- --><\/span><span>\n<!-- --><\/span><\/code><\/pre>\n<\/div>\n<p>Upon the completion of the execution cycle, the program-counter is incremented to proceed to the subsequent instruction and it continues this process until it has concluded.<br \/>\n<!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">The EVM possesses an additional method to\u00a0<!-- --><em class=\"chakra-text css-0\">alter<!-- --><\/em>\u00a0the program-counter via what is referred to as\u00a0<!-- --><em class=\"chakra-text css-0\">jump<!-- --><\/em>-instructions (<!-- --><em class=\"chakra-text css-0\">JUMP<!-- --><\/em>\u00a0&amp;\u00a0<!-- --><em class=\"chakra-text css-0\">JUMPI).\u00a0<!-- --><\/em>Rather than allowing the program-counter to increment (pc++), the EVM has the capability to leap to arbitrary locations within the contract code. There are two jump instructions known to the EVM: a standard jump that is interpreted as \u201c<!-- --><em class=\"chakra-text css-0\">jump to position X<!-- --><\/em>\u201d and a conditional jump which is interpreted as \u201c<!-- --><em class=\"chakra-text css-0\">jump to position X if condition Y is satisfied<!-- --><\/em>\u201d. Whenever such a jump takes place, it must consistently land on a\u00a0<!-- --><em class=\"chakra-text css-0\">jump-destination<!-- --><\/em>. If the execution lands on an instruction that is not a jump destination, the program fails\u200a\u2014\u200ain essence, for a jump to be valid, it must invariably be succeeded by a jump-destination instruction if the conditionyielded true.<!-- --><\/p>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">Before executing any Ethereum application, the EVM traverses through the code to identify all potential jump-targets, subsequently cataloging them in a map that can be referenced by the program-counter for retrieval. Each time the EVM comes across a jump-instruction, the validity of the jump is verified.<!-- --><\/p>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">As you may notice, the executing code is fairly straightforward and effortlessly interpreted by the byte-code VM, leading us to the conclusion that despite its simplicity, it is fundamentally quite primitive.<!-- --><\/p>\n<p><!-- --><\/p>\n<h3 class=\"chakra-heading css-145upk7\" id=\"0544\">Introducing JIT VM<!-- --><\/h3>\n<p>The JIT-EVM adopts a distinct method for executing EVM byte-code and is, by nature,\u00a0<!-- --><em class=\"chakra-text css-0\">initially<!-- --><\/em>\u00a0less efficient than the byte-code VM. Before the VM can execute any code, it must first\u00a0<!-- --><em class=\"chakra-text css-0\">transform<!-- --><\/em>\u00a0the byte-code into segments that the JIT VM can comprehend.<br \/>\n<!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">The setup and execution process is carried out in three phases:<!-- --><\/p>\n<p><!-- --><\/p>\n<ol role=\"list\" class=\"css-13a5a39\">\n<li class=\"css-cvpopp\">We verify if there exists a JIT program ready for execution using the code\u2019s hash\u200a\u2014\u200a<!-- --><em class=\"chakra-text css-0\">H(C)<!-- --><\/em>\u00a0serves as an identifier for the program;<!-- --><\/li>\n<li class=\"css-cvpopp\">if a program is located, we execute it and return the output;<!-- --><\/li>\n<li class=\"css-cvpopp\">if no program is found, we execute the byte-code\u00a0<!-- --><em class=\"chakra-text css-0\">and<!-- --><\/em>\u00a0compile a JIT program in the background.<!-- --><\/li>\n<\/ol>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">Initially, I attempted to check if the JIT program had completed compilation and to transfer the execution to the JIT\u200a\u2014\u200athis all transpired during runtime in the same loop using Go\u2019s\u00a0<!-- --><em class=\"chakra-text css-0\">atomic<!-- --><\/em>\u00a0package\u200a\u2014\u200ahowever, it was unfortunately slower than allowing the byte-code VM to execute and subsequently utilizing the JIT program for every sequential invocation post-program compilation completion.<!-- --><\/p>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">By segmenting the byte-code into logical components, the JIT gains the capability to examine the code more accurately and to optimize whenever necessary.<!-- --><\/p>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">For instance, an exceedingly simple optimization I implemented was consolidating several\u00a0<!-- --><em class=\"chakra-text css-0\">push<!-- --><\/em>\u00a0operations into a single command. Consider the\u00a0<!-- --><em class=\"chakra-text css-0\">CALL\u00a0<!-- --><\/em>instruction; it necessitates 7 push commands\u200a\u2014\u200ai.e. gas, address, value, input-offset, input-size, return-offset, and return-size\u200a\u2014\u200abefore execution, and instead of iterating through these 7 commands one by one, I\u2019ve streamlined the process by gathering the 7 commands and appending the 7 values into a single slice. Now, whenever the\u00a0<!-- --><em class=\"chakra-text css-0\">beginning<!-- --><\/em>\u00a0of the 7 push commands is executed, it performs the optimized instruction by instantly appending the static slice to the VM stack. Of course, this is only applicable for static values (i.e.\u00a0<!-- --><em class=\"chakra-text css-0\">push 0x10),<!-- --><\/em> which frequently occur in the code.<!-- --><\/p>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">Additionally, I enhanced the\u00a0<!-- --><em class=\"chakra-text css-0\">static jump\u00a0<!-- --><\/em>commands. Static jumps are those that consistently redirect to the same location (i.e.\u00a0<!-- --><em class=\"chakra-text css-0\">push 0x1, jump<!-- --><\/em>) and remain unchanged under any conditions. By identifying which jumps are static, we can pre-validate whether a jump is legitimate and falls within the contract&#8217;s limits, and if so, we generate new instructions that replace both the\u00a0<!-- --><em class=\"chakra-text css-0\">push<!-- --><\/em>\u00a0and\u00a0<!-- --><em class=\"chakra-text css-0\">jump<!-- --><\/em>instructions, marking it as\u00a0<!-- --><em class=\"chakra-text css-0\">valid<!-- --><\/em>. This alleviates the VM from executing two instructions and eliminates the need to confirm the legitimacy of the jump, thus avoiding the costly hash-map lookup for valid jump locations.<!-- --><\/p>\n<p><!-- --><\/p>\n<h4 class=\"chakra-heading css-1u9mv6z\" id=\"20a3\">Subsequent Steps<!-- --><\/h4>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\">Comprehensive stack and memory evaluation would also integrate seamlessly into this architecture, allowing substantial blocks of code to consolidate into single commands. Furthermore, I aspire to incorporate\u00a0<!-- --><a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-ug8vf0\" href=\"https:\/\/en.wikipedia.org\/wiki\/Symbolic_execution\">symbolic-execution<!-- --><\/a>\u00a0and transform the JIT into a fully functional JIT-VM. I believe this would be a logical progression once the programs grow large enough to leverage these optimizations.<!-- --><\/p>\n<p><!-- --><\/p>\n<h3 class=\"chakra-heading css-145upk7\" id=\"c1b6\">Final Thoughts<!-- --><\/h3>\n<p><!-- --><\/p>\n<p class=\"chakra-text css-gi02ar\"><span class=\"graf-dropCap\">O<!-- --><\/span>ur JIT-VM is significantly more intelligent than the byte-code VM yet remains far from completed (if ever). There are numerous additional clever techniques we could implement within this framework, but they simply aren\u2019t feasible at present. The execution time is within the parameters of being \u201creasonably\u201d swift. Should the necessity arise to further optimize the VM, we possess the resources to achieve that.<!-- --><\/p>\n<p><!-- --><\/p>\n<h4 class=\"chakra-heading css-1u9mv6z\" id=\"06ef\">Additional Code Review<!-- --><\/h4>\n<p><!-- --><br \/>\nCross posted from &#8211;\u00a0https:\/\/medium.com\/@jeff.ethereum\/go-ethereums-jit-evm-27ef88277520#.1ed9lj7dz<!-- --><\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/blog.ethereum.org\/en\/2016\/06\/02\/go-ethereums-jit-evm\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Ethereum Virtual machine stands out as somewhat unique compared to the majority of other Virtual Machines available. In my\u00a0earlier article\u00a0I elaborated on its usage and highlighted several of its features. The Ethereum Virtual Machine (EVM) is a basic yet potent, Turing complete 256-bit Virtual Machine that permits anyone to run arbitrary\u00a0EVM Byte Code. The<\/p>\n","protected":false},"author":3,"featured_media":8282,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[1496],"class_list":["post-9119","post","type-post","status-publish","format-standard","has-post-thumbnail","category-ethereum","tag-return-a-list-of-comma-separated-tags-from-this-title-go-ethereums-jit-evm-ethereum-foundation-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency - WSJ-Crypto<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency - WSJ-Crypto\" \/>\n<meta property=\"og:description\" content=\"The Ethereum Virtual machine stands out as somewhat unique compared to the majority of other Virtual Machines available. In my\u00a0earlier article\u00a0I elaborated on its usage and highlighted several of its features. The Ethereum Virtual Machine (EVM) is a basic yet potent, Turing complete 256-bit Virtual Machine that permits anyone to run arbitrary\u00a0EVM Byte Code. The\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/\" \/>\n<meta property=\"og:site_name\" content=\"WSJ-Crypto\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-28T17:36:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"2100\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"wsjcrypto\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"wsjcrypto\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/\",\"url\":\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/\",\"name\":\"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency - WSJ-Crypto\",\"isPartOf\":{\"@id\":\"https:\/\/wsj-crypto.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg\",\"datePublished\":\"2025-02-28T17:36:36+00:00\",\"author\":{\"@id\":\"https:\/\/wsj-crypto.com\/#\/schema\/person\/88a93723b30416db1a352d5a0096c4a7\"},\"breadcrumb\":{\"@id\":\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#primaryimage\",\"url\":\"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg\",\"contentUrl\":\"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg\",\"width\":2100,\"height\":900},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wsj-crypto.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wsj-crypto.com\/#website\",\"url\":\"https:\/\/wsj-crypto.com\/\",\"name\":\"WSJ-Crypto\",\"description\":\"Just Another Crypto News Website\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wsj-crypto.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wsj-crypto.com\/#\/schema\/person\/88a93723b30416db1a352d5a0096c4a7\",\"name\":\"wsjcrypto\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/wsj-crypto.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/86fe8af82ea089646d6639ca2f87e0243d8688d957bd8e3ec22ec3c457cc16d4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/86fe8af82ea089646d6639ca2f87e0243d8688d957bd8e3ec22ec3c457cc16d4?s=96&d=mm&r=g\",\"caption\":\"wsjcrypto\"},\"url\":\"https:\/\/wsj-crypto.com\/index.php\/author\/wsjcrypto\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency - WSJ-Crypto","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/","og_locale":"it_IT","og_type":"article","og_title":"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency - WSJ-Crypto","og_description":"The Ethereum Virtual machine stands out as somewhat unique compared to the majority of other Virtual Machines available. In my\u00a0earlier article\u00a0I elaborated on its usage and highlighted several of its features. The Ethereum Virtual Machine (EVM) is a basic yet potent, Turing complete 256-bit Virtual Machine that permits anyone to run arbitrary\u00a0EVM Byte Code. The","og_url":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/","og_site_name":"WSJ-Crypto","article_published_time":"2025-02-28T17:36:36+00:00","og_image":[{"width":2100,"height":900,"url":"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg","type":"image\/jpeg"}],"author":"wsjcrypto","twitter_card":"summary_large_image","twitter_misc":{"Scritto da":"wsjcrypto","Tempo di lettura stimato":"5 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/","url":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/","name":"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency - WSJ-Crypto","isPartOf":{"@id":"https:\/\/wsj-crypto.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#primaryimage"},"image":{"@id":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#primaryimage"},"thumbnailUrl":"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg","datePublished":"2025-02-28T17:36:36+00:00","author":{"@id":"https:\/\/wsj-crypto.com\/#\/schema\/person\/88a93723b30416db1a352d5a0096c4a7"},"breadcrumb":{"@id":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#primaryimage","url":"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg","contentUrl":"https:\/\/wsj-crypto.com\/wp-content\/uploads\/2025\/02\/eth-org.jpeg","width":2100,"height":900},{"@type":"BreadcrumbList","@id":"https:\/\/wsj-crypto.com\/index.php\/2025\/02\/28\/unveiling-go-ethereums-jit-evm-elevating-performance-and-efficiency\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wsj-crypto.com\/"},{"@type":"ListItem","position":2,"name":"Unveiling Go Ethereum\u2019s JIT-EVM: Elevating Performance and Efficiency"}]},{"@type":"WebSite","@id":"https:\/\/wsj-crypto.com\/#website","url":"https:\/\/wsj-crypto.com\/","name":"WSJ-Crypto","description":"Just Another Crypto News Website","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wsj-crypto.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Person","@id":"https:\/\/wsj-crypto.com\/#\/schema\/person\/88a93723b30416db1a352d5a0096c4a7","name":"wsjcrypto","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/wsj-crypto.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/86fe8af82ea089646d6639ca2f87e0243d8688d957bd8e3ec22ec3c457cc16d4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86fe8af82ea089646d6639ca2f87e0243d8688d957bd8e3ec22ec3c457cc16d4?s=96&d=mm&r=g","caption":"wsjcrypto"},"url":"https:\/\/wsj-crypto.com\/index.php\/author\/wsjcrypto\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/posts\/9119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/comments?post=9119"}],"version-history":[{"count":2,"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/posts\/9119\/revisions"}],"predecessor-version":[{"id":9121,"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/posts\/9119\/revisions\/9121"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/media\/8282"}],"wp:attachment":[{"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/media?parent=9119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/categories?post=9119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wsj-crypto.com\/index.php\/wp-json\/wp\/v2\/tags?post=9119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}