From a senior to future senior Hackers

Latest Posts

View all posts →

Latest Videos

View all videos →
Profiling an Electron App's Real Memory Hogs Before a Rust Rewrite

Profiling an Electron App's Real Memory Hogs Before a Rust Rewrite

Discord's Rust rewrite took Windows memory from up to 4GB down to roughly 290MB. That number can be accurate and still tell you nothing about your Electron app. This is the profiling procedure to run before anyone on the team says the word "rewrite": what process.memoryUsage() actually measures, why a flat heap chart means you're looking at the wrong tool, per-process sampling with app.getAppMetrics(), per-renderer detail from the CDP Performance domain, a deterministic Playwright workload that makes two runs comparable, and the four numbers that decide the question — floor, warm-up peak, steady state and leak rate. Full write-up: https://hackyjs.com/posts/profiling-an-electron-apps-real-memory-hogs-before-a-rust-rewrite

electronrustmemory-profiling
Why Appending to Your Agent's System Prompt Breaks Prompt Caching

Why Appending to Your Agent's System Prompt Breaks Prompt Caching

Appending a timestamp or status line to an agent's system prompt changes the prompt prefix on every turn. Prompt caching matches only a contiguous token range from position zero, so the first changed token ends reuse and everything after it is reprocessed at full price. The post reports a case where a task that should have cost about $21 billed about $200, explains the arithmetic, and shows a cache-stable ordering: static system prompt first, volatile text at the tail. Full write-up: https://hackyjs.com/posts/why-appending-to-your-agents-system-prompt-breaks-prompt-caching

llm-agentsprompt-cachinginference-cost
Chrome 157's LanguageDetector on Android: Test It Without a Backend

Chrome 157's LanguageDetector on Android: Test It Without a Backend

Chrome 157 reportedly ships on-device language detection on Android, and the interesting part isn't the detection call. It's that availability() is the API. This walkthrough covers why `'LanguageDetector' in window` is a false positive, what the four availability states mean, and how a typed capability probe lets callers tell a missing API from a model that still needs a download. Then a backend-free test harness: serve a static page over adb reverse and localhost counts as a secure context. Finally, the fallback ladder that still stays in place, plus the caveats worth flagging, since the release claim comes from secondary coverage and needs checking against the primary release notes. Full write-up: https://hackyjs.com/posts/testing-chrome-157s-languagedetector-api-on-android-without-a-backend

chrome-157language-detectorandroid