-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Regression deserializing a subclassed source #347
Comments
I'd indeed use Cython cast to builtin type in order to improve performance, as builtin operations can be optimized. For example, However, following your issue, I've made a quick benchmark, and the result was surprising: adding the cast (with an additional variable) is in fact slower for small lists (but it's better as expected for bigger lists). That's why I've finally removed this cast. |
@pchanial By the way, could you give more details about your use case with buitin subtypes? |
Thanks for the quick fix. We were just emulating PEP 584 in some unit tests on a Python 3.8 environment, but there could be less trivial other use cases, such as relying on defaultdict, Counter or OrderedDict. |
I don't think
Benchmark is not a trivial things, and apischema's one is just here to give a rough estimation of the relative performance in comparison to alternatives. But it's really poor and not reliable if you want some precise results, like tracking performance regressions. |
Out of curiosity, why does the deserializer use the |
The following code works correctly when cythonization is disabled:
Cythonization triggers an LSP violation: the last line fails with the error:
The text was updated successfully, but these errors were encountered: