AI 资讯
A Day of Performance Hardening: Hunting N+1s and Killing Wasted Queries in Laravel
Performance work has a reputation for being glamorous — the heroic "we cut latency by 80%" story. Most days it's not that. Most days it's a janitorial pass: you go looking for the queries you're firing without realizing it, and you quietly delete them. That was today. One sustained sweep across an app and the package that backs it, chasing the same theme everywhere: stop asking the database for things you don't use. Let me walk through the patterns, because they generalize to any Laravel app of a certain age. First, make the invisible visible You can't fix N+1s you can't see. The first move was wiring up an N+1 detector in the local/dev environment only — beyondcode/laravel-query-detector . It hooks into the request lifecycle, watches your Eloquent relationship loads, and screams (in the console, or as an exception if you want it strict) when it spots the classic loop-and-lazy-load pattern. The "dev-only" part matters. You never want a query detector running in production — it adds overhead and it's a developer aid, not a runtime guard. So it goes in behind an environment check, registered only when the app isn't in production: public function register (): void { if ( $this -> app -> environment ( 'local' , 'testing' )) { $this -> app -> register ( \BeyondCode\QueryDetector\QueryDetectorServiceProvider :: class ); } } Think of it like a smoke detector you only arm while you're cooking. It's noisy by design — that's the point. The noise is a to-do list. Eager loads you don't actually use are just N+1s wearing a disguise Here's the counterintuitive one. We're all trained to fix N+1s by adding with() . But the opposite bug is just as common and almost never gets caught: you eager-load a relationship, and then... never touch it in the view. Index screens are the worst offenders. Someone builds a listing, eager-loads creator and approver so the table can show names, then a redesign drops those columns — but the with(['creator', 'approver']) stays. Now every page load hyd
AI 资讯
Meta’s smart glasses now have a dedicated charging stand
Meta launched a stand accessory that lets you display the company's smart glasses on your desk or nightstand while they're being recharged. The new Charging Stand is listed at $59 on Meta's website - $30 less than the charging case for Meta's non-Ray-Ban glasses - and resembles a metal tube with a groove you can […]
AI 资讯
Just in Time for July Fourth, I Found 3 Great Yeti Cooler Deals (2026)
Yeti coolers are very nice and very expensive. Three very different models are on sale right now.
AI 资讯
Dev Log: 2026-06-22 — Configurable Schedulers, Load-Test Toolkits, and an MCP Server
Some days the work spreads across a few projects instead of landing as one big feature. Today was that — three distinct threads, each with a lesson worth keeping. I'll keep things generic and teach the pattern rather than the project, but the through-line is the same: move things that were hardcoded or ephemeral into something you can configure, repeat, and trust. Thread 1 — Make scheduled tasks configurable instead of code-only If you've run a Laravel app for any length of time, you know the scheduler lives in code: routes/console.php or the kernel, a wall of ->daily() , ->everyFiveMinutes() , ->cron(...) . That's fine until the day an operator — not a developer — needs to change when something runs. Then you're shipping a deploy just to nudge a cron expression. Silly. Today's work pulled scheduler configuration into a settings-backed UI. The pattern is worth stealing: instead of the schedule being a literal in code, the code reads its cadence from a settings store, and there's an admin screen to edit it. // Instead of a hardcoded cadence... $schedule -> command ( 'subscriptions:reconcile' ) -> daily (); // ...read it from settings, with a sane default baked in. $schedule -> command ( 'subscriptions:reconcile' ) -> cron ( $this -> schedulerSettings -> reconcileCron ?? '0 2 * * *' ); Two things made this clean. First, a SchedulerSettings object (Spatie's settings pattern) so the values are typed, cached, and migratable — not loose rows you Setting::get('...') by string key. Second, grouping the more user-facing schedules behind their own modal rather than dumping every cron in one giant form. A subscription-related schedule belongs next to subscriptions; a platform schedule belongs in admin. Same data, but organized by who needs to touch it . The edge case to watch: a UI-editable cron is a foot-gun if you let people type nonsense. Validate the expression on save, and always keep a default so a blank setting can never silently disable a job. Thread 2 — A load-testing
AI 资讯
Block Ads Across Your Entire Network: Why AdGuard Home Overtakes
Why AdGuard Home Overtook Pi-hole Last month, while attempting to add ad filtering to the internal network of a production ERP system, the Pi-hole configuration escalated to 85% CPU usage within an hour, causing DNS responses to lag. AdGuard Home resolved the same scenario with 3% CPU and an average latency of 15 ms , which is why it has dethroned Pi-hole. In the following sections, I detail the architecture, performance, security features, and my real-world deployment experience with both products. While they may seem similar at first glance, the fundamental differences directly impact network stability and management overhead. How AdGuard Home Works AdGuard Home is designed as a fully modular DNS forwarder that supports DNS‑over‑HTTPS (DoH) and DNS‑over‑TLS (DoT). Clients first send queries over 53 UDP/TCP or 443 DoH; AdGuard caches the query, checks it against local blacklists, and then forwards it to an upstream DNS service based on preference. # /etc/AdGuardHome.yaml (partial) bind_host : 0.0.0.0 bind_port : 53 upstream_dns : - https://1.1.1.1/dns-query - https://9.9.9.9/dns-query blocking_mode : default blocked_response_ttl : 300 $ dig @127.0.0.1 example.com +short 93.184.216.34 $ curl -s -H "Accept: application/dns-json" "https://adguard.example/dns-query?name=ads.google.com&type=A" | jq . { "Status" : 0, "Answer" : [] , "Question" : [ { "name" : "ads.google.com." , "type" : 1 } ] } Why is it so fast? Cache-first strategy : The initial query goes to an upstream DNS, but subsequent identical domains are returned directly from RAM cache. Parallel upstreams : Since multiple DoH endpoints are tried concurrently, the primary response time drops to an average of 15 ms. Advanced blocklist engine : Thanks to a combination of regex-based filtering and Bloom filters, thousands of ad domains are eliminated in a single query. This architecture, when running as a systemd-based service, shows only 12 ms CPU consumption in systemd-analyze blame output; Pi-hole showed 150 ms
科技前沿
Best Prime Day Beauty Deals of 2026 (We Sifted Through Hundreds to Pick Them)
It wouldn't be Amazon Prime Day without some beauty deals. Here's a roundup of all our favorites.
AI 资讯
Amazon's Best Fire TV Stick Is Almost Half Off (2026)
The Fire TV Stick 4K Max is a cheap way to stream content and is especially tailored for Prime Video devotees.
科技前沿
The Best Mesh Router Is at Its Best Price Ever This Prime Day
Do you crave speedy, reliable Wi-Fi throughout your home? Snag one of these Prime Day router or mesh deals.
AI 资讯
HaloBraid raises $7M from Seven Seven Six to end the six-hour hair salon appointment
HaloBraid aims to help salons speed up braiding with its first device, slated to launch later this year, that acts as a braiding assistant for professional stylists.
开发者
Best Prime Day Action Cameras Deals I've Found (2026): GoPro, Insta360
Action cameras are perfect for capturing travel adventures, recording social media vlogs, and more. Make use of these great Prime Day deals.
科技前沿
14 Walmart Deals We Like Better Than That Other Sale Happening Right Now
Welcome to Walmart deals for folks who’d rather not shop at Amazon. These are the best gadget deals at Walmart this Prime Day.
开发者
I Love This Anker Power Bank So Much I Own Two—It's Now on Sale
The Anker 737 is my personal go-to power bank, and it's on sale for Amazon Prime Day.
科技前沿
Stop Worrying About Storms with This Jackery Power Station—Half Off for Prime Day (2026)
Pick up this deal on Jackery's whole home backup battery and be ready for the next power outage.
AI 资讯
Meta debuts new, cheaper smart glasses under its own brand
The smart glasses are available in several countries starting today in a variety of color and lens combinations.
创业投融资
4 days left to save up to $190 on TechCrunch Founder Summit 2026
Four days left to save up to $190 on your pass to TechCrunch Founder Summit 2026 - the ultimate founder bootcamp - before Early Bird rates end on June 26 at 11:59 p.m. PT. Register here.
创业投融资
Ribbie turns real-time baseball stats into arcade-like, pixel-art broadcasts
Ribbie lets you follow along live with MLB games with a delightful, arcade-inspired interface.
AI 资讯
Sony releases trailer for Taika Waititi's Klara and the Sun
Tonally, the trailer gives strong vibes akin to the director's 2016 feature Hunt for the Wilderpeople .
科技前沿
Best Prime Day Streaming Deals I’ve Found (2026): HBO, Paramount Plus
Prime Day isn’t just about cheap TVs. It's also about cheap stuff to watch on your cheap TV.
AI 资讯
The Oura Ring 4 is as low as $226 for Prime Day
Yes, the Oura Ring 5 just launched. But if you’re looking for a bargain and don’t mind a slightly thicker smart ring, then copping the last-gen Oura Ring 4 is still a smart and savvy move. Especially since the price is as low as $226 in most sizes and color schemes at Amazon for Prime […]
创业投融资
Meta Glasses hands-on: Ray-Ban is out, Kylie Jenner is in
Here come the Meta Adventurer, Meta Fury and Meta Glasses by Kylie (Jenner).