Skip to content
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

Make Elysia easier to maintain and debug by setting aot: false by default #770

Closed
remorses opened this issue Aug 7, 2024 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@remorses
Copy link

remorses commented Aug 7, 2024

What is the problem this feature would solve?

Aot mode is very difficult to debug and maintain because it relies on creating a code string, transforming it with Sucrose and evaluating it at runtime

Aot mode should not be the default, it makes it super hard to debug issues because stack traces don’t point to any file, you instead have to debug the code generation code itself

For example currently there is a bug where throwing in the first line of an async generator handler crashes the server, I could not fix this issue in #742 because I would have to change at least 20 signature calls in the aot code generation without type safety and clear understanding of what branches get executed.

in my opinion speeding up Elysia by a few milliseconds by complicating 10x the whole codebase is not worth it. The only benefit of this feature are synthetic benchmarks, it does not improve real applications performance

What is the feature you are proposing to solve the problem?

Make aot false by default and deprecate it over time. Fix all the tests that currently fail with aot disabled

What alternatives have you considered?

No response

@SaltyAom
Copy link
Member

Performance is one of the key factor that I made Elysia, and willing to trade some DX for the said problem.

However, I agreed with closing aot:false issues.

So I'm not going implement this, closing as not planned.

@SaltyAom SaltyAom closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
@crishoj
Copy link
Contributor

crishoj commented Oct 25, 2024

IMO, as long as aot is available to developers, the whole test suite should pass both with aot: true and aot: false.

@kravetsone
Copy link
Contributor

IMO, as long as aot is available to developers, the whole test suite should pass both with aot: true and aot: false.

totally agree
elysia should run test in two modes

but for now we can add WARNING for aot: false mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants