From fabc398130abaab48f84f0e21c6755c8fb6dc836 Mon Sep 17 00:00:00 2001 From: Hoarfroster Date: Tue, 31 Dec 2024 00:43:07 +0800 Subject: [PATCH] Add glossary term `Just-In-Time Compilation (JIT)` (#37418) * Add glossary term 'just-in-time compilation' * minor improvements * Update files/en-us/glossary/just_in_time_compilation/index.md --------- Co-authored-by: Brian Smith --- files/en-us/glossary/compile/index.md | 4 +++- .../just_in_time_compilation/index.md | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 files/en-us/glossary/just_in_time_compilation/index.md diff --git a/files/en-us/glossary/compile/index.md b/files/en-us/glossary/compile/index.md index a5f3e17081c0183..68e311202917679 100644 --- a/files/en-us/glossary/compile/index.md +++ b/files/en-us/glossary/compile/index.md @@ -10,7 +10,7 @@ page-type: glossary-definition Typically, a compiler transforms code written in a higher-level language such as [C++](https://en.wikipedia.org/wiki/C++), [Rust](), or [Java]() into executable (runnable) code — so-called **binary code** or **machine code**. [WebAssembly](/en-US/docs/WebAssembly), for example, is a form of executable binary code that [can be compiled from code written in C++, Rust, C#, Go, Swift, and several other languages](https://webassembly.org/getting-started/developers-guide/) and run on any web page, with most features supported in modern browsers (see [browser compatibility table](/en-US/docs/WebAssembly#browser_compatibility)). -Most compilers perform either ahead-of-time (AOT) compilation or just-in-time (JIT) compilation. +Most compilers perform either ahead-of-time (AOT) compilation or {{glossary("Just In Time Compilation", "just-in-time (JIT)")}} compilation. The GNU `gcc` compiler is one well-known example of an AOT compiler. AOT compilers are typically invoked from the command line in a shell environment (from within a terminal or console) or within an {{Glossary("IDE")}}. @@ -22,3 +22,5 @@ Compilers may also translate among higher-level languages — for example, from - [Compiler](https://en.wikipedia.org/wiki/Compiler) on Wikipedia - [WebAssembly](/en-US/docs/WebAssembly) +- Related glossary terms: + - {{glossary("Just In Time Compilation", "Just-In-Time (JIT)")}} diff --git a/files/en-us/glossary/just_in_time_compilation/index.md b/files/en-us/glossary/just_in_time_compilation/index.md new file mode 100644 index 000000000000000..4281497be7ad367 --- /dev/null +++ b/files/en-us/glossary/just_in_time_compilation/index.md @@ -0,0 +1,19 @@ +--- +title: Just-In-Time Compilation (JIT) +slug: Glossary/Just_In_Time_Compilation +page-type: glossary-definition +--- + +{{GlossarySidebar}} + +**JIT** (_Just-In-Time Compilation_) is a {{glossary("compile", "compilation")}} process in which code is translated from an intermediate representation or a higher-level language (e.g., {{glossary("JavaScript")}} or Java bytecode) into machine code _at runtime_, rather than prior to execution. This approach combines the benefits of both interpretation and ahead-of-time (AOT) compilation. + +JIT compilers typically continuously analyze the code as it is executed, identifying parts of the code that are executed frequently (hot spots). If the speedup gains outweigh the compilation overhead, then the JIT compilers will compile those parts into machine code. The compiled code is then executed directly by the processor, which can result in significant performance improvements. + +JIT is commonly used in modern {{glossary("browser", "web browsers")}} to optimize the performance of JavaScript code. + +## See also + +- [Just-In-Time Compilation](https://en.wikipedia.org/wiki/Just-in-time_compilation) on Wikipedia +- Related glossary terms: + - {{glossary("compile")}}