You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I have a question regarding the performance implications for conditionally including a has_many association using Panko::Serializer::SKIP. Specifically, I am using Panko::ArraySerializer in the following implementation:
Performance Impact: Are there any known performance concerns or optimizations related to the use of Panko::ArraySerializer in this context? Specifically, how does it affect serialization performance, especially with large sets of question_instructions?
Potential Improvements: Are there any potential improvements or refactorings that could be considered to enhance performance
Thank you!
The text was updated successfully, but these errors were encountered:
dev-nomi
changed the title
Conditional Inclusion of has_many Association Using Panko::Serializer::SKIP
Conditional inclusion of has_many association using Panko::Serializer::SKIP
Aug 17, 2024
dev-nomi
changed the title
Conditional inclusion of has_many association using Panko::Serializer::SKIP
Conditional inclusion of has_many association using Panko::Serializer::SKIPAug 17, 2024
Yes, there will be a performance impact because you're creating an array serializer repeatedly. In my codebase, we do this in some cases where it's acceptable performance-wise, but in other cases, we avoid it because it becomes too slow. I suggest running benchmarks with your data to determine if the performance hit is acceptable for your use case.
If the performance impact is too high, unfortunately, Panko doesn't currently provide a built-in solution to handle this efficiently. However, you can use a workaround like adding a method to your model, for example:
Hey! I have a question regarding the performance implications for conditionally including a has_many association using
Panko::Serializer::SKIP
. Specifically, I am usingPanko::ArraySerializer
in the following implementation:Questions:
Panko::ArraySerializer
in this context? Specifically, how does it affect serialization performance, especially with large sets of question_instructions?Thank you!
The text was updated successfully, but these errors were encountered: