Urgent.News

What's breaking now, across thousands of outlets.

Tech

Architectural Breakdown: Generosity Is a Default Setting

![ Architecture Diagram ]( https://image.pollinations.ai/prompt/high+performance+cloud+systems+Generosity+Is+a+Default+Settin+round+2?width=800&height=400&nologo=true ) # Zero-Data USB Tether Diagnostics: Why 11 Out of 14 Phones Hit 15 Mbps Until I Found One Setting Eleven phones. Fifteen megabits per second. Exactly fifteen. Not fourteen. Not sixteen. The other three hit 106 Mbps for reasons…

Zero-Data USB Tether Diagnostics: Eleven phones hit 15 Mbps, while three others reached a whopping 106 Mbps. After two hours of frustration, the author decided to build a diagnostic engine from scratch without relying on npm, Node.js, or a 300MB of dependencies. The architecture involved Python, asyncio, collections, dataclasses, and raw subprocess calls.

The author's goal was to measure the throughput of USB tethered devices without wasting resources. Initially, they considered installing adb, spinning up a Node server, and piping throughput data through request with retry logic, aggregating the data into InfluxDB. However, this approach required 50 dependencies and 400MB of RAM, leaving little room for actual measurement.

The author's solution involved writing the diagnostic engine in Python, using only asyncio, collections, dataclasses, and subprocess calls. The key to their approach was minimizing memory usage and avoiding unnecessary allocations. They created a BoundedThroughputEngine class with a circular buffer and Welford's online statistics algorithm, eliminating the need for repeated list() conversions.

To run the tests on multiple devices, the author implemented a USBTetherOrchestrator class that handles USB enumeration, ADB bridge, and concurrency limiting. They used asyncio.Semaphore to limit the number of concurrent tests and asyncio.sleep(0) after each run to prevent event loop starvation. This approach allowed them to measure the performance of 14 devices without deadlocking or resource exhaustion.

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

Markdown Tricks for Cleaner Docs

Write Docs People Actually Enjoy Reading Markdown is everywhere: READMEs, wikis, API docs, even internal memos. But most of what I see is plain and underused.

AuthGeek: a desktop TOTP authenticator with an Argon2 vault and no cloud sync

Hi DEV! I was fed up picking up my phone to type a six digit code into the machine I was already sitting at. The desktop authenticators I tried either wanted an account, synced my secrets to their…

  • AuthGeek authenticator stores data locally without cloud sync
  • Uses Argon2id for secure key derivation over PBKDF2
  • Supports encrypted backup and restore for multi-machine use

More from Sunday 6 September →