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

Performance optimization #232

Closed
wyfo opened this issue Oct 31, 2021 · 0 comments · Fixed by #235
Closed

Performance optimization #232

wyfo opened this issue Oct 31, 2021 · 0 comments · Fixed by #235
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@wyfo
Copy link
Owner

wyfo commented Oct 31, 2021

apischema is already among the fastest (if not the fastest) of all competitor libraries. That's not enough.
Some libraries use code generation to optimize their performance, but it's out of question to do that, because it makes development a lot harder (and apischema has a lot more functionalities)

Dynamic code optimization (AST refactoring) has been tried this summer, and if the performance gain was noticeable (about 10%), the cost at runtime was too high (100% for (de)serialization method creation). This method has thus been abandoned.

Also, code compilation seemed to be impossible because apischema is built on closures/nested functions, which are not supported by Cython/Numba.

However, rewriting closures as methods — with all the captured variables as fields of the method class — allows to be supported by Cython/Numba.

@wyfo wyfo added the enhancement New feature or request label Oct 31, 2021
@wyfo wyfo self-assigned this Oct 31, 2021
@wyfo wyfo added this to the v0.17 milestone Nov 2, 2021
@wyfo wyfo closed this as completed in #235 Nov 3, 2021
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

Successfully merging a pull request may close this issue.

1 participant