Urgent.News

What's breaking now, across thousands of outlets.

Tech

Benchmark Android User Journeys with Macrobenchmark

Unit tests can prove that a ViewModel returns the right state, but they cannot measure the latency and frame behavior a user experiences across a sequence of screens and a real application process. To understand real-world responsiveness, you need to use Macrobenchmark with UI Automator to drive a complete interaction from process launch to the user-visible refreshed state, then analyze frame and…

Unit tests verify ViewModel state correctness, but cannot measure user-perceived latency or frame performance across multiple screens. To assess real-world responsiveness, employ Macrobenchmark with UI Automator to simulate a complete end-to-end user journey from app launch to visible refreshed state, analyzing frame timings and milestones.

The key to performance testing is scope: unit tests test isolated code paths, UI tests validate functional correctness, while Macrobenchmark measures end-to-end user interactions under controlled conditions. This approach uncovers performance issues missed by isolated tests, such as delays in rendering lists or handling complex layout inflation during navigation.

To run a reliable Macrobenchmark, configure the app for profile mode rather than debug mode, as the latter introduces JVM debugging overhead that skews real-world timings. Build a dedicated benchmark variant of your app, using the same release signing configuration but with a .benchmark suffix for the package name. Drive the application flow using UI Automator, launching the process, performing touch and input actions, and measuring frame metrics without modifying app bytecode.

The benchmark test class should coordinate between the test runner and the target app process, measuring startup and frame timings for repeated iterations (e.g., 5 iterations) of a representative user flow. After each benchmark run, ensure proper data isolation to avoid side effects like database bloat or backend clutter. Use a staging environment, automated cleanup routines, or disposable test fixtures.

Run multiple iterations to obtain reliable performance metrics, filtering out transient noise from factors like thermal throttling or CPU frequency scaling. By comprehensively measuring user journeys with Macrobenchmark, you can establish repeatable performance baselines that capture multi-screen rendering behavior and overall application responsiveness.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I built my friend a voice-based recipe note-taking app

What I built Built a browser-based app which takes audio input from the microphone and transcribes it into recipe notes/memo. Building for a Friend Made it for my friend, Arnesh.

  • Browser-based app records audio and converts it into recipe notes.
  • Uses microphone APIs and Transformers.js with open Whisper-tiny model.
  • Structured code into modules for audio, transcription, parsing, storage, rendering.

Микросервисы и «зоопарк» баз данных: почему маленьким командам это не всегда нужно

В конце 2000-х главным вопросом проектирования был «SQL или NoSQL». Прошло полтора десятилетия, и оказалось, что победителя нет — но не потому, что все договорились.

  • 55% of services with >10 child resolve spans in GraphQL queries
  • Small teams find zoo of 3-5 databases problematic to manage
  • PostgreSQL often covers 90% of tasks for small teams

Stop Hand-Rolling an Exclusive Accordion. `<details name>` Does It

You're building an FAQ page. Ten questions, each collapsed by default, and — this part's in every design spec — only one answer open at a time. Click a second question, the first one closes.

  • Native details and summary tags provide built-in accordion functionality.
  • name attribute enforces mutual exclusivity across multiple details elements.
  • Grouping related elements with the same name simplifies accordion implementation.

Nuxt 4.5 SSR Streaming: The Route Rules That Disable It

Your team flips experimental.ssrStreaming: true in nuxt.config.ts , loads the homepage, and Time to First Byte drops from 1.8 seconds to 40 milliseconds. Everyone's thrilled.

  • Experimental.ssrStreaming improves TTFB from 1.8s to 40ms
  • Six route rules opt out of streaming: redirect, cache, isr, swr, noScripts, ssr: false
  • These rules prevent streaming due to response header limitations

More from Sunday 4 October →