Urgent.News

What's breaking now, across thousands of outlets.

Tech

Optimizing a single Rust Clippy lint by 3133X

This article details the optimization of a single Rust Clippy lint called clippy::nonstandard_macro_braces. This lint identifies macro calls with incorrect braces, as Rust macros are not strictly defined. To investigate, the author first checks if the current tokens come from macro expansion. They then trace the source text for the span of the macro expansion, ultimately determining the correct brace using string manipulation.

By calling hygiene data functions twice and locking the symbol interner, the author engages in a recursive loop that impacts Clippy's runtime. The author emphasizes that this issue is not the fault of a single contributor but rather a broader problem that open source maintainers must address. They propose rewriting the problematic function to a pre-expansion lint, eliminating the need for source text calculation, symbol interner locking, and session globals locking.

As a result, Clippy now has a benchmarking server and the optimization has significantly reduced runtime, saving hundreds of thousands of computing dollars.

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

Read the original at blog.goose.love →

More in Tech

My checker blamed the other tool, and the defect was in the one doing the blaming

A verifier went red and named a neighbouring tool as the cause. Three of eight rows could not be matched, and the reason code said the rows had the wrong shape. Two things were wrong with that.

  • Three out of eight rows failed to match in verification tool
  • Reason code misleadingly blamed neighboring tool for defect
  • Fix involved removing line numbers and ensuring one block per row

The .NET HTTP Failure Nobody Sees Coming -Najeeb Ullah

Your CPU is fine. Your memory is fine. Your database is fine. So why did the application suddenly stop calling another service?

  • ASP.NET Core app stops calling external services in production
  • Repeatedly creating/disposing HttpClient exhausts OS ephemeral ports
  • Optimizing TCP connection management resolves issue

More from Saturday 12 September →