-
Notifications
You must be signed in to change notification settings - Fork 502
Fix typos and grammatical errors in jit-compiler.md #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,13 +27,13 @@ Elysia is fast and will likely remain *one of the fastest web frameworks for Jav | |||||||||||||||||
| <Benchmark /> | ||||||||||||||||||
| </section> | ||||||||||||||||||
|
|
||||||||||||||||||
| Elysia speed is not only acheived by optimization for specific runtime eg. Bun native features like `Bun.serve.routes`. But also the way Elysia handles route registration and request handling. | ||||||||||||||||||
| Elysia speed is not only achieved by optimization for specific runtime eg. Bun native features like `Bun.serve.routes`. But also the way Elysia handles route registration and request handling. | ||||||||||||||||||
|
|
||||||||||||||||||
| Elysia has an **JIT "compiler"** embedded within its core since [Elysia 0.4](/blog/elysia-04) (30 Mar 2023) at (*src/compose.ts*) using `new Function(...)` or also known as `eval(...)`. | ||||||||||||||||||
| Elysia has a **JIT "compiler"** embedded within its core since [Elysia 0.4](/blog/elysia-04) (30 Mar 2023) at (*src/compose.ts*) using `new Function(...)` or also known as `eval(...)`. | ||||||||||||||||||
|
||||||||||||||||||
|
|
||||||||||||||||||
| The *"compiler"* is not a traditional compiler that translates code from one language to another. Instead, it dynamically generates optimized code for handling requests based on the defined routes and middleware. *(Which is why we put compiler in quotes.)* | ||||||||||||||||||
|
|
||||||||||||||||||
| When request is made to Elysia application for the first time for each route, Elysia dynamically generates optimized code specifically tailored to handle that route efficiently on the fly avoiding unnecessary overhead as much as possible. | ||||||||||||||||||
| When a request is made to the Elysia application for the first time for each route, Elysia dynamically generates optimized code specifically tailored to handle that route efficiently on the fly avoiding unnecessary overhead as much as possible. | ||||||||||||||||||
|
||||||||||||||||||
| When a request is made to the Elysia application for the first time for each route, Elysia dynamically generates optimized code specifically tailored to handle that route efficiently on the fly avoiding unnecessary overhead as much as possible. | |
| The first time a request is made for a route in the Elysia application, Elysia dynamically generates optimized code specifically tailored to handle that route efficiently, on the fly, avoiding unnecessary overhead as much as possible. |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of grammar issues remain in this paragraph: “this handler only need” should be “only needs”, and “Sucrose looks at code” should be “looks at the code” for natural English.
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar/pluralization: this should be “various smaller optimizations”, and “like” reads better with a colon (“… optimizations like:”). Also, in the bullets below, verb agreement and phrasing need fixes (e.g., “conditionally uses …” and “when dealing with headers”).
| There are various smaller optimization like | |
| - using **Bun.websocket** when running on Bun for optimal WebSocket performance | |
| - `Elysia.file` conditionally use `Bun.file` when available for faster file handling | |
| - using `Headers.toJSON()` when running on Bun to reduce overhead when dealing headers | |
| There are various smaller optimizations like: | |
| - using **Bun.websocket** when running on Bun for optimal WebSocket performance | |
| - `Elysia.file` conditionally uses `Bun.file` when available for faster file handling | |
| - using `Headers.toJSON()` when running on Bun to reduce overhead when dealing with headers |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is redundant: the previous sentence already states the “if not handled properly” condition, and this line repeats it without adding new information. Consider removing it or replacing it with a concrete example of what “handled properly” means in Elysia’s case.
| But that's only true if not handled properly. | |
| In Elysia's case, "handled properly" means that generated functions are built only from trusted framework code (such as Sucrose and registered schemas), never directly from raw user input or request data. |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalization/grammar: “Elysia (sucrose)” should likely be “Elysia (Sucrose)”, and “the only framework that use” should be “frameworks that use”.
| Elysia takes precautions to ensure that the generated code is safe and does not expose vulnerabilities by making sure that only trusted code is executed. The **input is almost never user-controlled** and produced by Elysia (sucrose) itself. | |
| ## Libraries that `eval` | |
| Elysia is not the only framework that use `new Function` and `eval`. | |
| Elysia takes precautions to ensure that the generated code is safe and does not expose vulnerabilities by making sure that only trusted code is executed. The **input is almost never user-controlled** and produced by Elysia (Sucrose) itself. | |
| ## Libraries that `eval` | |
| Elysia is not the only framework that uses `new Function` and `eval`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence is still grammatically awkward: consider using possessive and plural forms and avoiding the sentence break after “runtime”. For example, “Elysia’s speed is achieved not only through optimizations for specific runtimes (e.g., Bun-native features like …) but also through …”