Skip to content
Back to Blog

Tagged: Performance

Laravel chunk vs lazy vs cursor: lazy() Is as Slow as chunk()

I seeded a MySQL table with 1,000,000 orders and walked through every row with each of five Laravel methods for iterating a big query: chunk(), chunkById(), lazy(), lazyById() and cursor(). chunkById() finished in 21.9 seconds and lazyById() in 22.3, neither above 5.9 MB of PHP memory. chunk() and lazy() held just as little and took about six times as long. cursor(), which the Laravel docs offer as a way to "significantly reduce your application's memory consumption", finished behind both ById methods and held 100.4 MB.

· 9 min read ·

Two Fixes Made Claude Code 15x Faster Per Command on Windows

I ran echo in Claude Code 178 times last week. Median time: 7,395 milliseconds. Not a build. Not a test suite. A command that prints a word and exits. I'd filtered down to commands that do nothing at all, no pipes, no loops, no subshells, because I wanted to know what the tool costs when it isn't doing anything. Claude Code had felt heavy for weeks. I'm on Windows 11 with Claude Code running through Git Bash, and I'd filed the sluggishness under "the model is thinking." It wasn't the model. Two local fixes later, that same echo returns in under half a second and a file read went from 909 ms to 24 ms.

Stay in the Loop

Get the latest posts delivered to your inbox - on your schedule.

No spam. Unsubscribe anytime.