Topics / Better algorithms

Performance topic

Better algorithms

Changing the algorithm or data structure: a lower complexity class, an index instead of a scan, an incremental update instead of a recompute. Usually the largest speedups in the database, and the ones a profiler alone does not suggest.

6,505proven techniques
44pitfalls: tried, then slower
1,134repositories
3,033from papers

Examples from real commits

ProjectPhysX/FluidX3D 500× Cast one ray per domain column instead of per voxel, collect hit distances, sort them, then fill voxels along the column by parity toggling. proof: commit → rust-num/num-complex 500× Replace naive division with Knuth Algorithm D using single-digit quotient estimation and in-place arithmetic. proof: commit → sgl-project/sglang-omni 400× Replace degenerate Conv3d with F.linear by reshaping input and weight to perform a GEMM. proof: commit → BLAST-WarpX/warpx 300× Replace Fisher-Yates with a modular linear-congruential permutation (i*step+offset) mod n over subgroups, parallelized over particles with a few repeated rounds. proof: commit → v8/v8 270× Flatten same-flag non-capturing groups to make consecutive assertions adjacent for folding. proof: commit → memgraph/memgraph 222× Store found paths in a trie of edge Gids; a root prefix's children are the edges to block, so walking the base path down the trie costs one step per deviation. proof: commit → benfulcher/hctsa 100× Replace the N x N Gram double sum of cubed inner products with the squared norm of the d x d x d third-moment tensor, then subtract the banded Theiler pairs. proof: commit → WebAssembly/binaryen 50.3× Replace the reverse-postorder queue with a weak-topological-order worklist that runs each loop to fixpoint before its successors. proof: commit →

Languages

  • C++1,671
  • C606
  • Rust471
  • Python437
  • CUDA244
  • Go155

Hardware

  • CPU1,435
  • NVIDIA GPU687
  • GPU449
  • x86341
  • ARM117

Fields

  • data & compression1,294
  • graphics1,095
  • math1,056
  • general976
  • compilers975

Where these come from

Repositories with the most techniques on this topic in the database:

thofma/Hecke.jl · 25mratsim/constantine · 18nmap/nmap · 14golang/go · 13flintlib/flint · 12mruby/mruby · 12colmap/colmap · 12Nemocas/Nemo.jl · 12angr/angr · 12libigl/libigl · 12

Ask Claude for the full answer

Each technique comes with its bottleneck, measured speedup, trade-offs, conditions and the commit or paper behind it, served to Claude through MCP.

claude mcp add --transport http adtomic https://www.adtomic.co/mcp

Connect Claude Pricing

Related topics

Precomputation and memoizationAvoiding allocationsEarly exit and pruningBit tricks and strength reductionBatching