23a59c216d72c12545edc2ab0b83bf21ca7dd47f
rockyou import was ~195s of actual CPU work spread across 42 minutes wall clock: Postgres was fsync-bound, not CPU/parallelism-bound (each batch was its own implicit-commit transaction). Wrapping each batch in an explicit transaction with synchronous_commit=off, and raising the default batch size 20000 (also used for wordlist worker chunking, previously hardcoded to 2000), brought the same import down to ~25 minutes wall clock / ~186s user time. Next bottleneck to address: B-tree index maintenance cost as it outgrows shared_buffers (confirmed via pg_stat_user_tables: 14.3M live tuples, zero dead tuples on a fresh DB, so it's not autovacuum/bloat). Random-order inserts into the (prefix, suffix) index cause disk-bound page faults once the index no longer fits in cache, which matched the observed end-of-run slowdown and the "N-at-a-time" stalls lining up with --jobs concurrency.
Description
A small Pwned Passwords API recreation based on the Have I Been Pwned idea, using node + postgres
Languages
TypeScript
95.9%
JavaScript
3.3%
HTML
0.8%