@@ -20,6 +20,14 @@ Simula un endpoint de ingesta de IoT **real** que:
2020- Ejecuta procesamiento CPU-intensivo: validación, enriquecimiento, cálculos Monte Carlo
2121- ** SIN sleeps artificiales** - workload realista
2222
23+ ### ⚡ ** Benchmark 3: Ultra-Fast NestJS + SQLite**
24+ NestJS ** completamente optimizado** para máximo rendimiento:
25+ - Framework NestJS completo (decoradores, DI, Fastify adapter)
26+ - Base de datos SQLite (Bun nativo vs Node.js)
27+ - ** SIN background processing** - solo HTTP + DB
28+ - ** Prepared statements** optimizados
29+ - ** Memory allocation** minimizada
30+
2331## 🏆 Resultados de los Benchmarks
2432
2533### Configuración de Prueba
@@ -117,6 +125,9 @@ cd iot-bench
117125
118126# 5. Benchmark Realista (sin sleeps artificiales)
119127./run_realistic_benchmark.sh
128+
129+ # 6. Ultra-Fast NestJS + SQLite (máximo rendimiento)
130+ ./run_ultra_fast.sh
120131```
121132
122133## 📁 Estructura del Proyecto
@@ -147,6 +158,9 @@ iot-bench/
147158├── run_nestjs_benchmark.sh # Benchmark NestJS (Node.js/Bun)
148159├── run_realistic_benchmark.sh # Benchmark Realista (sin sleeps)
149160├── realistic-server.js # Servidor con workload realista
161+ ├── run_ultra_fast.sh # Benchmark Ultra-Fast NestJS
162+ ├── ultra-fast-server.ts # NestJS optimizado al máximo
163+ ├── ultra-fast.controller.ts # Controlador ultra-optimizado
150164└── clustered-server.js # Servidor multi-core clustering
151165```
152166
@@ -165,6 +179,13 @@ iot-bench/
165179- ** Dependency Injection** y arquitectura modular
166180- ** SQLite3** (in-memory, equivalente a H2)
167181
182+ ### NestJS Ultra-Fast
183+ - ** NestJS 10.2.8** completamente optimizado
184+ - ** Bun.sqlite nativo** vs ** Node.js SQLite3**
185+ - ** Prepared statements** pre-compilados
186+ - ** Memory allocation** minimizada
187+ - ** Sin background processing** ni overhead innecesario
188+
168189### Node.js/Bun Puro
169190- ** Fastify 4.24.3** (framework web rápido)
170191- ** SQLite3** (in-memory, equivalente a H2)
@@ -193,9 +214,10 @@ iot-bench/
193214- ❌ ** NO para processing puro** o workloads CPU-intensivos
194215
195216** 🥇 Bun**
217+ - ✅ ** GANADOR ABSOLUTO optimizado** (21,154 req/sec con NestJS)
196218- ✅ ** GANADOR para workloads realistas** (7,024 req/sec)
219+ - ✅ ** SQLite nativo 11.3x más rápido** que Node.js
197220- ✅ ** APIs y microservicios modernos** con processing intensivo
198- - ✅ ** Aplicaciones IoT** con validación y cálculos
199221- ✅ ** Cuando el rendimiento máximo es crítico**
200222- ⚠️ ** Usar APIs nativas** (Bun.sqlite, Bun.serve)
201223
@@ -238,6 +260,13 @@ iot-bench/
2382604 . ** ☕ Java tradicional MEJOR** que Virtual Threads para CPU: 4,413 req/sec
2392615 . ** 🎯 El workload determina todo** : I/O vs CPU cambia completamente el ranking
240262
263+ #### ⚡ ** Del Benchmark Ultra-Fast (¡CONFIRMACIÓN!):**
264+ 1 . ** 🚀 Bun + NestJS DOMINA** : 21,154 req/sec (** +89.6%** vs Node.js)
265+ 2 . ** 📊 Confirma benchmarks oficiales** : Bun SQLite es superior
266+ 3 . ** 🎯 Framework completo** : NestJS + decoradores + DI + Fastify
267+ 4 . ** ⚡ Optimización importa** : Eliminar overhead innecesario es clave
268+ 5 . ** 🏆 Bun puede ganar** cuando se optimiza correctamente
269+
241270#### 💡 ** Lecciones Universales:**
242271- ** Bun + APIs nativas** = Rendimiento superior
243272- ** Virtual Threads** = Solo para I/O bloqueante específico
@@ -246,6 +275,32 @@ iot-bench/
246275
247276---
248277
278+ ## ⚡ ** BENCHMARK 3: Ultra-Fast NestJS + SQLite**
279+ * Framework completo optimizado al máximo*
280+
281+ ### Resultados Optimizados
282+
283+ | Framework | Runtime | Requests/sec | Transfer/sec | Latencia (avg) | Mejora vs Node.js | Rank |
284+ | -----------| ---------| -------------| --------------| ---------------| ------------------| ------|
285+ | ** 🥇 NestJS Ultra-Fast** | ** Bun + SQLite nativo** | ** 21,154** | ** 3.47MB** | 92ms | ** +89.6%** | ** 1º** 🚀 |
286+ | ** 🥈 NestJS Ultra-Fast** | ** Node.js + SQLite3** | ** 11,157** | ** 2.35MB** | 120ms | ** Referencia** | ** 2º** ⚡ |
287+
288+ ### 🎯 ** ¡Finalmente Bun Domina con NestJS!**
289+
290+ #### ✅ ** Optimizaciones Aplicadas:**
291+ - ** Prepared statements** reutilizados
292+ - ** Memory allocation** minimizada
293+ - ** Sin background processing** que interfiera
294+ - ** Fastify ultra-optimizado**
295+ - ** Bun.sqlite nativo** vs node-sqlite3
296+
297+ #### 📊 ** Confirmación de Benchmarks Oficiales:**
298+ - ** SQLite puro** : Bun 886K ops/sec vs Node.js 78K ops/sec (** +11.3x** )
299+ - ** HTTP + SQLite** : Bun 21K req/sec vs Node.js 11K req/sec (** +89.6%** )
300+ - ** Coincide con** [ benchmarks oficiales de Bun] ( https://github.com/oven-sh/bun/tree/main/bench/sqlite )
301+
302+ ---
303+
249304## 🚀 ** BENCHMARK 2: Procesamiento Realista**
250305* Sin sleeps artificiales - workload CPU-intensivo real*
251306
0 commit comments