Member Since 2 Years Ago
1,190 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Thanks both, we'll look in to those things. We've also hit upon something nice too for getting the query results back with the relationships in them as plain arrays in the first place, which is super fast in the response. Just need to work out what to try and make dynamic, what to cache and what to turn in to resources. Also looking at how to make the DB query idea we have found into a query method so it can be re-used.
Started a new Conversation Generating JSON Responses From Collections Extremely Slow
We use Laravel (and love it) on several large scale web applications, and a couple of them are now getting some large amounts of data being returned in some queries, and also more specifically, some heavily nested relationships. We have optimised all the queries etc to run this efficiently and are getting query times from the debug bar that we are (mostly) happy with.
However, then attempting to return those collections from our API to the front end is horrendously slow. A complex object for example that takes 0.8-1.2 seconds to load from the database is then taking a further 11 seconds to convert the collection in to an array to be returned as json to the front end API call. And this collection has only 1 item in it (just with lots of nested relationships).
Does anyone else experience this issue? If so, how have you gone about solving it? Right now we are working through and finding that we may need to change a large number of things to do all the relationships as separate flat items that we then get as arrays rather than collections and stitch back together, so was hoping to see if anyone knew of a better way to optimise this? It feels like this is probably something the whole community would benefit from if we can work it out!
Thanks in advance for any ideas!