1 pointby zhidao94 hours ago1 comment
  • zhidao94 hours ago
    I built jsbench because tools like wrk and ab are fast but hard to script, while k6 and autocannon are scriptable but sacrifice raw throughput.

      The key idea: for simple benchmarks (URL, request object, array of endpoints),
      JS is only used at startup to read your config. The actual benchmark loop is
      a C state machine with epoll and keep-alive — no JS overhead. For complex
      scenarios (auth flows, chained requests), it falls back to a per-thread
      QuickJS runtime with a standard fetch() API.
    
      The first version was written entirely by Claude Code (Opus 4.6) — I provided
      the architecture, the AI wrote all ~2,800 lines of C. AI is great at
      "make it work", but I'm not satisfied with the internal design yet,
      so I'm now refactoring by hand.
    
      Limitations: Linux only (epoll).
    
      Would love feedback on the API design and scripting model.