Performance implications of making all properties lazy #356
-
Hi all I’m building a complex app with REST, GraphQL and web routes. There’s a lot of shared logic and laravel-data seems like a great way to centrally manage types and validation rules. Only thing is, each route needs a different combination of properties. Would there any performance penalty if I just made all properties in all data objects lazy? Or is there a better way to approach this? Thanks :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't think there will a performance penalty, since evaluating lazy is simply resolving closures. Parsing the includes requires some array and string operations but I don't think that is going to matter when transforming a data object. |
Beta Was this translation helpful? Give feedback.
I don't think there will a performance penalty, since evaluating lazy is simply resolving closures. Parsing the includes requires some array and string operations but I don't think that is going to matter when transforming a data object.