@@ -128,6 +128,9 @@ cd iot-bench
128128
129129# 6. Ultra-Fast NestJS + SQLite (máximo rendimiento)
130130./run_ultra_fast.sh
131+
132+ # 7. Ultra-Fast Spring Boot (comparación justa)
133+ ./run_spring_ultra_fast.sh
131134```
132135
133136## 📁 Estructura del Proyecto
@@ -161,6 +164,8 @@ iot-bench/
161164├── run_ultra_fast.sh # Benchmark Ultra-Fast NestJS
162165├── ultra-fast-server.ts # NestJS optimizado al máximo
163166├── ultra-fast.controller.ts # Controlador ultra-optimizado
167+ ├── run_spring_ultra_fast.sh # Benchmark Ultra-Fast Spring Boot
168+ ├── UltraFastController.java # Controlador Spring Boot optimizado
164169└── clustered-server.js # Servidor multi-core clustering
165170```
166171
@@ -186,6 +191,14 @@ iot-bench/
186191- ** Memory allocation** minimizada
187192- ** Sin background processing** ni overhead innecesario
188193
194+ ### Spring Boot Ultra-Fast
195+ - ** Spring Boot 3.2.0** completamente optimizado
196+ - ** H2 Database** (in-memory, equivalente a SQLite)
197+ - ** JdbcTemplate** con prepared statements
198+ - ** Virtual Threads ON/OFF** para comparación
199+ - ** Sin AsyncWorker** ni background processing
200+ - ** Logging minimizado** para máximo rendimiento
201+
189202### Node.js/Bun Puro
190203- ** Fastify 4.24.3** (framework web rápido)
191204- ** SQLite3** (in-memory, equivalente a H2)
@@ -260,12 +273,12 @@ iot-bench/
2602734 . ** ☕ Java tradicional MEJOR** que Virtual Threads para CPU: 4,413 req/sec
2612745 . ** 🎯 El workload determina todo** : I/O vs CPU cambia completamente el ranking
262275
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
276+ #### ⚡ ** Del Benchmark Ultra-Fast (¡EMPATE TÉCNICO !):**
277+ 1 . ** 🏆 Spring Boot GANA ** : 22,289 req/sec (VT OFF) - ** Ganador absoluto **
278+ 2 . ** 🤝 Empate técnico ** : Solo 5.4% diferencia entre Spring Boot y NestJS+Bun
279+ 3 . ** 🔥 NestJS + Bun ** : Mejor latencia (92ms vs 135ms)
280+ 4 . ** 💡 Virtual Threads ** : OFF mejor que ON para workloads simples (-1.3%)
281+ 5 . ** 🎯 Framework parity ** : Ambos frameworks alcanzan ~ 21-22K req/sec optimizados
269282
270283#### 💡 ** Lecciones Universales:**
271284- ** Bun + APIs nativas** = Rendimiento superior
@@ -282,10 +295,12 @@ iot-bench/
282295
283296| Framework | Runtime | Requests/sec | Transfer/sec | Latencia (avg) | Mejora vs Node.js | Rank |
284297| -----------| ---------| -------------| --------------| ---------------| ------------------| ------|
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º** ⚡ |
298+ | ** 🥇 Spring Boot Ultra-Fast** | ** Java 21 (VT OFF)** | ** 22,289** | ** 3.60MB** | 135ms | ** +99.8%** | ** 1º** 🚀 |
299+ | ** 🥈 Spring Boot Ultra-Fast** | ** Java 21 (VT ON)** | ** 21,999** | ** 3.55MB** | 168ms | ** +97.2%** | ** 2º** ⚡ |
300+ | ** 🥉 NestJS Ultra-Fast** | ** Bun + SQLite nativo** | ** 21,154** | ** 3.47MB** | 92ms | ** +89.6%** | ** 3º** 🔥 |
301+ | ** NestJS Ultra-Fast** | ** Node.js + SQLite3** | ** 11,157** | ** 2.35MB** | 120ms | ** Referencia** | 4º |
287302
288- ### 🎯 ** ¡Finalmente Bun Domina con NestJS !**
303+ ### 🎯 ** ¡Comparación Justa: Framework vs Framework !**
289304
290305#### ✅ ** Optimizaciones Aplicadas:**
291306- ** Prepared statements** reutilizados
@@ -294,10 +309,18 @@ iot-bench/
294309- ** Fastify ultra-optimizado**
295310- ** Bun.sqlite nativo** vs node-sqlite3
296311
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 )
312+ #### 📊 ** Resultados Clave:**
313+ - ** 🏆 Spring Boot (VT OFF)** : 22,289 req/sec - ** Ganador absoluto**
314+ - ** ⚡ Spring Boot (VT ON)** : 21,999 req/sec - Solo 1.3% más lento
315+ - ** 🔥 NestJS + Bun** : 21,154 req/sec - ** Mejor latencia** (92ms)
316+ - ** 💡 Virtual Threads** : No siempre mejoran el rendimiento
317+ - ** 🎯 Empate técnico** : Diferencia mínima entre los 3 primeros
318+
319+ #### 🤔 ** ¿Por qué Virtual Threads OFF gana?**
320+ - ** Menos overhead** de context switching
321+ - ** Thread pool tradicional** optimizado para este workload
322+ - ** Sin complejidad** de virtual thread scheduling
323+ - ** Workload simple** : No necesita miles de threads concurrentes
301324
302325---
303326
0 commit comments