Topic

Algorithms

Algorithm and data structure discussions covering complexity analysis, competitive programming, and practical implementation insights from developer communities.

What this topic tracks

  • Engineering practices and ecosystem debates
  • Tools, architecture, and implementation lessons
  • Relevant discussions from developer communities

Algorithms · 296 stories

Recent stories

Each story's summary, with the places it was discussed.

Summaries are written by AI from the linked sources. Open the source for full context.

20 stories

Turing Award winner and former Oxford professor Tony Hoare passed away

blog.computationalcomplexity.org · 10 Mar

Algorithms · Programming Languages · Computer Science

The tech world mourns Tony Hoare, the Turing Award winner and creator of quicksort and ALGOL, who passed away at 92.

Beyond his landmark contributions to Computer Science and Hoare logic, colleagues remember his humble personality, sharp wit, and professional career spanning early Soviet Union computer demonstrations to Microsoft Research.

Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache

blog.cloudflare.com · 27 Aug

Algorithms · Performance · Rust

Cloudflare optimized Big Pineapple’s DNS cache through five Rust storage changes: replacing growable collections, compacting section metadata, omitting repeated DNS owners, boxing large enum variants, and storing record data contiguously in wire format.

These reduced per-entry memory 56%, lowered fleet memory by roughly 100 TB, increased insert throughput 43%, and reduced lookup latency 19%.

Holy Shit Holy Shit Holy Shit Holy Shit [Algorithmic Complexity Lower Bounds]

scottaaronson.blog · 25 Nov

Artificial Intelligence · Algorithms · OpenAI · Mathematics · Computer Science

OpenAI and Anthropic reportedly used AI to prove several major results in complexity theory: VP ≠ VNP, the Riemann Hypothesis, and OpenAI’s claimed exact value ω=9/4 for matrix multiplication, including a matching lower bound.

OpenAI also claims the Fourier Transform requires N(log N)^(1/2+o(1)) linear gates, again with a matching lower bound, while QIP(2)=PSPACE was proved separately with AI assistance. The author sees this as a dramatic expansion of mathematical discovery, while warning that cryptography-related claims remain unverified.

ASCII characters are not pixels: a deep dive into ASCII rendering

alexharri.com · 17 Jan

Algorithms · Performance · Computer Science

In this technical exploration, Alex Harri details the creation of a high-performance image-to-ASCII renderer.

The author argues that traditional ASCII rendering often fails because it treats characters as square pixels, resulting in blurry and aliased edges. To solve this, Harri introduces the concept of shape-quantification by using multi-dimensional 'shape vectors' (up to 6D) to map image regions to characters that best match their contours. The analysis covers advanced topics such as supersampling, contrast enhancement via normalization and exponents, and directional contrast enhancement to eliminate 'staircasing' artifacts. Furthermore, the post addresses performance optimization through k-d trees, bit-packed caching, and GPU-accelerated sampling collection, transforming a computationally expensive process into a real-time experience.

Elevators

john.fun · 31 Jul

Algorithms · Performance · Computer Science

This article explores the complex algorithms behind elevator systems, such as SCAN, LOOK, and the Otis RSR method.

It analyzes performance metrics like wait time distributions and capacity optimization. While advanced features like Destination Dispatch exist, the analysis shows that traditional systems often provide superior flexibility and efficiency in typical building environments.

E-means: 10x faster k-means at equal loss

e-means.github.io · 9 Nov

Artificial Intelligence · Algorithms · Machine Learning · Performance · Computer Science

Meta FAIR’s open-source e-means replaces Lloyd’s k-means with mini-batch exponential moving averages, scaling-law-derived batch and step sizes, improved initialization, cosine scheduling, dead-cluster revival, finalization, and specialized kernels.

Across 24 datasets and configurations, it reaches the test loss of Lloyd after 25 epochs in 1.2–3 epochs, delivering 10–45× lower GPU wall-clock time and 8–15× lower CPU time while often achieving lower loss. It also escapes pathological local minima more reliably and reduces dead clusters.

Everyone Should Know SIMD

mitchellh.com · 22 Jul

Algorithms · Performance · Programming Languages

SIMD is often perceived as too complex for common programming, but it is actually accessible and follows a consistent pattern.

By broadcasting constants, looping in chunks, performing parallel operations, reducing results, and handling scalar tails, developers can achieve significant performance gains, often bypassing the limitations of compiler auto-vectorization.

I got paid minimum wage to solve an impossible problem (and accidentally learned why most algorithms make life worse)

open.substack.com · 7 Jan

Algorithms · Ethics · Computer Science

A Computer Science student recounts an experiment where they applied simulated annealing and the 2-opt heuristic to optimize sweeping routes at a grocery store.

Initially, the C++ optimizer prioritized the shortest path, leading to a technically efficient but practically unusable route filled with erratic turns. By introducing a turn penalty into the cost function, the student achieved a walkable, realistic path, illustrating that optimizing purely for data-driven metrics often fails human needs. The narrative connects this to real-world issues like social media engagement algorithms and LLMs, arguing that many modern problems arise from optimizing for the wrong cost functions, such as clicks over happiness or confidence over accuracy. Ultimately, the piece highlights that technical correctness is futile if the underlying goal disregards human reality.

Should you normalize RGB values by 255 or 256?

30fps.net · 1 Jun

Artificial Intelligence · Algorithms · Python

Converting 8-bit image data to floating point typically involves dividing by 255 (standard) or 256 (alternative).

The standard approach maps extremes to 0.0 and 1.0 but causes uneven bin distribution. The alternative improves theoretical precision and symmetry but shifts values away from zero. For general RGB processing, the standard 255-based normalization remains the industry best practice.

I built a world record exact solver for the minimum line cover of prime points after watching a Numberphile video. It turned the previous 282-hour record into 22 minutes, then kept going to prove 20 new awkward primes never certified before.

prime-line-cover.vercel.app · 12 May

Algorithms · Performance · Computer Science

Researchers reached a breakthrough in computing the minimum line cover for prime-indexed points.

Using an optimized branch-and-bound algorithm with Lagrangian relaxation and the Exclusive Dependency Rule, the solver certified f(1024)=143 in under 40 hours. This represents a 750x speedup over industrial solvers by leveraging cache locality, warm-starting, and structural properties of prime points.

Shlemiel the Painter Is Back: How Zig’s libc Rewrite Made SQLite Slower

dennisforbes.ca · 4 Nov

Algorithms · Backend · Performance · SQLite

A Zig libzigc rewrite of C string functions caused SQLite JSON ingestion to become dramatically slower in a Rust chess-analysis service.

When zig cc compiled SQLite for Linux, rewritten strspn, strcspn, strpbrk, and strstr repeatedly measured the remaining string length during tokenization, creating quadratic behavior. Processing about 40,000 records took minutes, and tokenizing a 1.2 MB file was approximately 12,000 times slower. Whitespace pruning helped, while moving Linux builds to containers avoided the issue.

An interactive explainer of how audio fingerprinting lets Shazam identify a song in seconds

perthirtysix.com · 20 Apr

Artificial Intelligence · Algorithms · Data Science

Music recognition apps like Shazam use the Fast Fourier Transform to convert raw audio into spectrograms.

By isolating prominent frequency peaks, they create unique audio fingerprints. These fingerprints are stored in an inverted index, allowing the system to instantly search millions of songs by matching hash coordinates rather than scanning entire audio files.

Anti-social: It's fads, not friends, which now dominate social media feeds

bbc.com · 8 Jun

Artificial Intelligence · Algorithms · Business

Social media platforms are shifting from personal connection hubs toward passive entertainment feeds driven by AI-powered algorithms.

Users post less personal content, migrating instead to private messaging apps for genuine interaction. While the business model thrives on ad revenue and engagement, the shift highlights a growing divide between entertainment discovery and actual social networking.

42x Faster Prompt Lookup Drafting in llama.cpp

jadidbourbaki.github.io · 26 Sept

Algorithms · C++ · Performance

Hayder Tirmazi details four llama.cpp optimizations for prompt lookup drafting: eliminating unnecessary map copies, replacing maps with faster data structures, and using constmap for the static cache.

Together, they deliver up to 42× faster drafting and 2.6× lower memory use, while preserving acceptance rates; static-cache loading also becomes up to 16× faster.

Performance Improvements in .NET 11

devblogs.microsoft.com · 15 Sept

Algorithms · Performance · Programming Languages

.NET 11 delivers hundreds of cumulative performance improvements across the JIT, runtime async, SIMD and intrinsics, garbage collection, threading, numerics, strings, LINQ, I/O, networking, JSON, diagnostics, and cryptography.

BenchmarkDotNet results show fewer allocations, bounds checks, branches, syscalls, and copies, plus faster startup and algorithms. The release also improves memory safety, tooling, APIs, and deployment efficiency.

A faster way to convert a timestamp to Hour, Min, Sec

benjoffe.com · 7 Sept

Algorithms · Low-Level Programming · Performance

The article redesigns conversion of a daily timestamp into hour, minute, and second by breaking dependency chains and replacing division with fixed-point multiplication.

Its V1, V2, and V3 algorithms achieve substantially lower latency—down to five cycles—while preserving throughput, with platform-specific SIMD variants. It also covers milliseconds, leap seconds, compiler limitations, and benchmark results across x86, ARM, and Apple Silicon.

Building a Procedural Hex Map with Wave Function Collapse

felixturner.github.io · 9 Mar

Algorithms · Performance · Computer Science

Interactive developer Felix Turner created a procedural 3D medieval map generator using Three.js, WebGPU, and the Wave Function Collapse (WFC) algorithm.

By implementing a hexagonal grid with 4,100 tiles, the project overcomes complex tiling constraints through multi-grid solving and backtracking. It features high-performance rendering via BatchedMesh and custom TSL shaders for atmospheric visual effects.

Advancing science & engineering with Antigravity’s /teamwork

research.google · 13 Nov

Artificial Intelligence · Algorithms · Computer Science · Gemini · AI Agents

Google reports that Antigravity’s /teamwork multiagent systems, paired with Gemini 4 models and human experts, solved or advanced open problems in mathematics, chemistry, and systems engineering.

Results include a full Lean 4 proof of the Courtade–Kumar conjecture, formalizations of major theorems, 95% top-1 molecular-structure accuracy, trillion-edge graph systems, faster Rust rewrites, and TPU-kernel speedups. The workflows use parallel agents, critics, and objective verifiers. /teamwork, /boost, and Deep Review are available in Antigravity, with free access offered to 10,000 researchers.

The time the x86 emulator team found code so bad they fixed it during emulation

devblogs.microsoft.com · 15 Jun

Algorithms · Performance · Computer Science

A developer recounts an old Windows x86-32 emulator for non-native processors.

The emulator used JIT binary translation for performance. It encountered a program with a loop-unrolled initialization function spanning 256KB for just 64KB of data. The emulation team implemented a special hack to replace this inefficient code with a compact, optimized loop.

Where it came fromHacker NewsRedditLobstersGoogle ResearchCreate a Snapbyte.dev digest and choose Algorithms as one of your topics.Build your digest