Faster Swift star catalogs

Almanac 0.12.1

Release Sky

Almanac 0.12.1 makes the Swift port draw many stars at one instant about twice as fast, for sky domes, star charts, and watch faces. The TypeScript and Kotlin ports and every result are unchanged.

  • Swift caches Earth's nutation and heliocentric state for the last instant it computed. Every star drawn at that instant reuses them. The cache is shared across threads behind a lock, needs no newer OS, and answers only the exact same instant, so a result never depends on earlier calls. #94

On an M-series Mac, a 1,024-star catalog at one instant costs 0.53 µs a star, down from 1.15 µs in 0.12.0. A single star followed across many instants costs the same as before, about 1.2 µs a call. Swift's other workloads are unchanged within the 20% gate.

npm install @openwaters/almanac@0.12.1
.package(url: "https://github.com/openwatersio/almanac.git", exact: "0.12.1")

Kotlin consumers can pin the v0.12.1 source checkout using the installation guide. No Maven artifact is published.

Swift star cache and benchmarks: #94. Release preparation: #95.

Full changelog.