-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add Liip Serializer to the official serializer benchmark application #8
Comments
great idea! we need to fix some bugs that crept into this version but once it works fine, it would be very interesting to see how it compares. if the models are reasonably small, there might not be much difference - the main benefit is on huge model structures. |
i looked into this, but the problem we have is that as we generate explicit code, we do not handle recursions in models. the categories of the benchmark are a recursive model. |
I understand. Seems to me that without much effort you would support
recursion, wouldn't?
Em qui, 28 de fev de 2019 13:50, David Buchmann <[email protected]>
escreveu:
… i looked into this, but the problem we have is that as we generate
explicit code, we do not handle recursions in models. the categories of the
benchmark are a recursive model.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA_iE3tfspL2v2z4dm1Dd-VbnQCdvbtLks5vSAjcgaJpZM4a63a4>
.
|
the way the code is currently generated, we unroll recursions and require to configure to stop them. see https://github.com/liip/metadata-parser/blob/87c9be0fc337fdf239ac5c97d87b8caff7bba74f/src/RecursionChecker.php#L100-L104 we developped this for a use case that did not have real recursion (there is sometimes one level of nesting, which is what the serialzer and metadata parser now can handle). i can totally see that it would be nice to support unknown levels of recursion. we would need to track the recursion when building the metadata, and a different handling in the code generator so that it handles recursions on deserialize and also on serialize, plus detects endless loops in serialize. i'd want to keep the current option of unrolling a known maximum recursion depth for optimal performance. if somebody wants to add support for actual recursion, i am happy to review it, but i don't have the time to develop it myself. |
to be more explicit about the performance: in our use case, the model tree has 1000s of objects (long lists of reasonably complex objects). even just calling a function for every object would lead to 50k or more function calls, which has a significant cost according to the code analyzer we ran. |
Hello,
Could you please add this library to the official serializer benchmark application?
https://github.com/php-serializers/ivory-serializer-benchmark
So we can compare its performance with others libraries.
The text was updated successfully, but these errors were encountered: