Posts tagged with performance

Creating custom relations in Laravel

stitcher.io

My colleague Brent solved a performance by creating a custom relation

One last solution that came to mind was to load all people, all contracts, and map them together manually. In the end that's exactly what I ended up doing, though I did it in the cleanest possible way: using custom relations.

Read more [stitcher.io]

Join thousands of developers

Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.

No spam. Unsubscribe anytime. You can also follow me on X.

Persistent Layout Patterns in Next.js

adamwathan.me

Adam Wathan explain how can avoid re-rendering the entire UI everytime you click a link in Next.js

Next.js is such a wonderfully productive development experience and produces such incredibly fast websites that I just refused to believe it had to be this way. So I spent a few weeks researching, asking questions, and experimenting, and came up with these four patterns for persistent layouts in Next.js applications.

Read more [adamwathan.me]

Making sense of API response times

www.codemonkey.io

Mathias Hansen shares how API response time data is used at Geocodio and how to work with this kind of data in MySQL.

The API is the backbone of our business, so over the years we have continously worked to improve and ensure consistent performance. We look at many parameters such as uptime and error rates, but one of the key metrics is API response time. This is how we use this data.

Read more [www.codemonkey.io]

Live updating Oh Dear! status pages

sebastiandedeyne.com

Sebastian De Deyne explains how the live updating on Oh Dear status pages works.

We were originally going to use Vue for the pages, so we could make the entire view reactive so we could easily fetch and update data with AJAX or websockets. I started building the status page view, but quickly became hesitant about the decision to use Vue. It didn’t feel like the right tool for the job.

Read more [sebastiandedeyne.com]

Event store optimizations in laravel-event-sourcing

by Freek Van der Herten – 5 minute read

About a year ago, we released laravel-event-projector. It focused on adding projectors, an important concept in event sourcing, to Laravel.

After the release of the package, we continually kept improving it. We added aggregates, a way to test those, a brand new section in the our documentation that explains event sourcing from scratch, and DX improvements all across the board.

We now feel confident that the package is a good starting point for getting started with event sourcing in Laravel. That's why we're renaming the package to laravel-event-sourcing.

Read more

Lazy collections in Laravel

github.com

Unsung Laravel hero Joseph Silber opened up a very interesting PR to Laravel. Let's hope this one gets accepted.

Whereas the existing Collection class wraps a native array, the new LazyCollection class wraps a native iterator, while still providing most of the methods that we know and love from a regular collection.

Read more [github.com]

Cost & Performance optimization in Laravel Vapor

divinglaravel.com

Mohammed Said shares some solid tips on optimizing costs when working in a serverless environment like Laravel Vapor

Laravel Vapor uses different AWS resources to efficiently get your application up and running in the serverless cloud. The building block of the whole thing is AWS Lambda, it's where the actual computing happens. Calculating the cost of the compute part for your application can be a bit confusing, so let's simplify it a bit with an example.

Read more [divinglaravel.com]

Viewing model counts in the Laravel Debugbar

reinink.ca

Jonathan Reinink has added a very usefull metric to Laravel debugbar

Last week at Laracon US I gave a talk titled Eloquent Performance Patterns. In that talk I used a custom Laravel Debugbar metric I created to track how many Eloquent models were being hydrated throughout a request. I've had a lot of people asking about this, so today I submitted a pull request to the Laravel Debugbar to add this as an official metric.

Read more [reinink.ca]

The case of the Laravel TestCase

timacdonald.me

Tim MacDonald, a freelance software developer based in Sydney, investigates how to make Laravel tests run faster. Turns out you a lot can be gained by caching the config.

I saw a conversation on Twitter the other day discussing how Laravel was slowing down a test suite. I decided I wanted to dig into this and see if there was anything to it.

Read more [timacdonald.me]

Your first performance budget with Lighthouse

bitsofco.de

Ire Aderinokun, Front-End Developer and User Interface Designer, explains how you can Lighthouse in CI.

Until recently, I also hadn't setup an official performance budget and enforced it. This isn’t to say that I never did performance audits. I frequently use tools like PageSpeed Insights and take the feedback to make improvements. But what I had never done was set a list of metrics that I needed the site to meet, and enforce them using some automated tool.

Read more [bitsofco.de]

Caching the entire response of a Laravel app

by Freek Van der Herten – 5 minute read

When a request comes in your app will return a response. To create that response, your application has to do some work. Most likely queries will execute. This all takes some time. Wouldn't it be nice if the same request comes in, we can return the response the application has constructed previously?

Read more

Find Segfaults in PHP like a boss

jolicode.com

Grégoire Pineau explains how you can find the source of a segfault in PHP.

Sometimes, a segfault happens, but you don’t know where, and your PHP installation does not have tools to find it. Or sometime, you think PHP is hanging, but you don’t know where. You may use xdebug, but you don’t want to click so many times on the « next call » button.

Read more [jolicode.com]