Collection::jsonSerialize bottleneck

Posted 2 years ago by youkaihiei

Hey all!

I'm working on a Laravel 5.2 api and according to New Relic the bottleneck in response time I'm experiencing is the jsonSerialize() method on Illuminate\Support\Collection - its serializing about 1500 models returned by the query thats executing, which doesn't really seem like a lot to me. But I don't know, maybe it is haha. Each model has maybe about 25 properties. Has anybody experienced anything like this before? Any advice on dealing with it? (other than caching)

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.