今日已更新 317 条资讯 | 累计 25867 条内容
关于我们

标签:#AR

找到 4454 篇相关文章

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

2026-06-23 原文 →
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 […]

2026-06-23 原文 →
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

2026-06-23 原文 →
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

2026-06-23 原文 →
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 […]

2026-06-23 原文 →