explaingit

isaac-mason/compilecat

Analysis updated 2026-05-18

65RustAudience · developerComplexity · 4/5Setup · moderate

TLDR

An experimental TypeScript/JavaScript compiler plugin that rewrites hot code paths before bundling, using opt-in comment annotations to apply inlining, loop unrolling, and scalar replacement for faster runtime performance.

Mindmap

mindmap
  root((compilecat))
    What it does
      Function inlining
      Loop unrolling
      Scalar replacement
      Dead code removal
    Directives
      @inline
      @sroa
      @unroll
      @optimize
    Tech Stack
      Rust core
      WebAssembly fallback
      Rollup plugin
      Vite plugin
    Use Cases
      Game engines
      3D math libs
      Performance modules
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Speed up a 3D math library by inlining vector operations and replacing array locals with scalar variables in hot loops

USE CASE 2

Reduce call overhead in a game engine's physics step by unrolling fixed-count loops and eliminating dead code

USE CASE 3

Optimize a TypeScript number-crunching module before shipping it as an npm package

USE CASE 4

Drop unused function calls from a bundle by marking pure helpers for tree-shaking

What is it built with?

RustTypeScriptJavaScriptRollupViteWebAssembly

How does it compare?

isaac-mason/compilecatcorrode/refactoring-rustdoggy8088/leak-hunter
Stars656157
LanguageRustRustRust
Setup difficultymoderateeasyeasy
Complexity4/52/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an existing Rollup, Vite, or Rolldown bundler setup to integrate the plugin.

In plain English

compilecat is an experimental plugin that makes JavaScript and TypeScript programs run faster by rewriting specific parts of your code before your bundler (like Rollup or Vite) packages everything together. You add special comment annotations to functions or loops in your code, and compilecat uses those hints to apply low-level optimizations that would normally only happen in compiled languages like C or Rust. The four main techniques it applies are: function inlining, where a small helper function's body gets pasted directly at each call site to avoid the overhead of calling it, scalar replacement of aggregates (SROA), which breaks apart small arrays or objects like 3D vectors into individual variables so the JavaScript engine can track them more efficiently, loop unrolling, where a loop with a fixed number of iterations gets replaced by writing out each iteration explicitly, and constant folding with dead code removal, where values that never change get computed at build time and unreachable code gets stripped. The plugin works at the source-file level, transforming each file before bundling, and it understands code that crosses module boundaries. If you mark a function in one file with the @inline annotation, the plugin can pull its body into other files that import and call it, then drop the now-unused import automatically. compilecat is built around a Rust-based parsing and transformation core and ships as a pre-compiled native binary for each platform, with a WebAssembly fallback for environments that don't match. Installing it requires only npm with no extra build tools. The project is highly experimental. The README warns clearly that it is not yet stable and the API may change at any time. It is best suited for developers working on performance-sensitive JavaScript libraries, particularly those doing math-heavy work like 3D graphics, game engines, or physics simulations where reducing overhead in tight loops adds up noticeably.

Copy-paste prompts

Prompt 1
Add @inline to all my vector math helpers in this TypeScript file and show me what the output looks like after compilecat processes them
Prompt 2
How do I configure compilecat in a Vite project to only transform files inside src/engine/?
Prompt 3
My for loop runs exactly 3 iterations over a fixed-size array -- show me how to apply compilecat's @unroll directive and what the unrolled output looks like
Prompt 4
What is scalar replacement of aggregates (SROA) and how does compilecat's @sroa directive apply it to a Vec3 local variable?
Prompt 5
I have a module-level scratch buffer const _scratch = [0,0,0]. Will compilecat's SROA localize it into per-call scalars, and what does the transformed output look like?

Frequently asked questions

What is compilecat?

An experimental TypeScript/JavaScript compiler plugin that rewrites hot code paths before bundling, using opt-in comment annotations to apply inlining, loop unrolling, and scalar replacement for faster runtime performance.

What language is compilecat written in?

Mainly Rust. The stack also includes Rust, TypeScript, JavaScript.

How hard is compilecat to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is compilecat for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub isaac-mason on gitmyhub

Verify against the repo before relying on details.