At the core of an ideal single-photon detector is an active material that absorbs and converts every incident photon to a discriminable signal. A large active material favours efficient absorption, but often at the expense of conversion efficiency, noise, speed and timing accuracy. In this work, short (8.5 mm long) and narrow (8 Â 35 nm 2 ) U-shaped NbTiN nanowires atop silicon-on-insulator waveguides are embedded in asymmetric nanobeam cavities that render them as near-perfect absorbers despite their small volume. At 2.05 K, when biased at 0.9 of the critical current, the resulting superconducting single-photon detectors achieve a near-unity on-chip quantum efficiency for B1,545 nm photons, an intrinsic dark count rate o0.1 Hz, a reset time of B7 ns, and a timing jitter of B55 ps full-width at half-maximum. Such ultracompact, high-performance detectors are essential for progress in integrated quantum optics.