Skip to content

CAT 049

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-049 — Thread.new → spawn

Severity: warning | Confidence: high | Auto-fix:

Description

Thread.new → spawn — Use Crystal's spawn (fiber-based concurrency) instead of Thread.new for lightweight concurrency.

Bad code

Thread.new { do_work }

Performance Impact

Tip

This rule can significantly improve performance in hot code paths.

Benchmark

Note

See bench results at bench/cat-049/

Clone this wiki locally