C
CanxJS
v1.6.2
  • Learn
  • Blog
  • Showcase
C
CanxJS

Ultra-fast async MVC backend framework for Bun. Build production-ready APIs with elegance and speed.

Resources

  • Documentation
  • Learn
  • Blog
  • Showcase

Documentation

  • Introduction
  • Installation
  • Core Concepts
  • CLI Commands
  • API Reference

Legal

  • Privacy Policy
  • Terms of Service

© 2026 CanxJS. All rights reserved.

Built with ❤️ for Candra Kirana

  • WebSockets
  • Task Scheduling
  • Queues
  • Job Batches
  • Caching
  • Events
  • Broadcasting
  • Notifications
  • SMS Channels
  • File Storage
  • Payment
  • Search
  • Security
  • Security Comparison
  • Performance
  • HTTP/2 Support
  • Deployment
Optimization

Performance

CanxJS includes advanced performance features like JIT compilation and request batching out of the box.

JIT Compiler

Compiles routes to regex for zero-overhead matching.

Request Batching

Combine multiple API calls into a single HTTP request.

Deduplication

Automatically remove duplicate requests in a batch.

Zero Overhead

Optimized for Bun's high-performance runtime.

Request Batching

Reduce HTTP overhead by combining multiple API operations into a single request.

batch.controller.ts
1import { createBatcher } from "canxjs";
2
3const batcher = createBatcher({
4 batchWindow: 50, // Collect requests for 50ms
5 maxBatchSize: 100,
6 dedupe: true // Remove duplicate identical requests
7});
8
9// Usage in controller
10@Post('batch')
11async handleBatch(@Body() requests: any[]) {
12 return await batcher.processBatch(requests, async (req) => {
13 // Process individual request
14 return await this.service.handle(req);
15 });
16}

JIT Compilation

CanxJS automatically compiles your routes into optimized Regular Expressions. No configuration needed.

debug.ts
1import { jitCompiler } from "canxjs";
2
3// JIT is automatic, but you can inspect stats
4const stats = jitCompiler.getStats();
5console.log(stats);
6// { compiledRoutes: 15, cacheHits: 12050, avgCompileTime: 0.05 }