MCPcopy Create free account
hub / github.com/avoidwork/tenso / main

Function main

benchmarks/memory.js:641–671  ·  view source on GitHub ↗

* Main execution function

()

Source from the content-addressed store, hash-verified

639 * Main execution function
640 */
641async function main () {
642 console.log("🔥 Memory Usage Benchmarks for Tenso Framework");
643 console.log("=".repeat(60));
644
645 if (!global.gc) {
646 console.log("⚠️ Note: Garbage collection not exposed. Run with --expose-gc for better results.\n");
647 }
648
649 try {
650 await testServerLifecycle();
651 await testRequestProcessing();
652 await testParserMemory();
653 await testRendererMemory();
654 await testRateLimitMemory();
655 await testHypermediaMemory();
656 await testMemoryLeaks();
657 await testMemoryPressure();
658
659 console.log("\n✅ Memory benchmarks completed\n");
660 console.log("💡 Tips for memory optimization:");
661 console.log(" - Monitor for consistent memory growth patterns");
662 console.log(" - Implement proper cleanup for expired rate limit entries");
663 console.log(" - Consider object pooling for high-frequency operations");
664 console.log(" - Use WeakMap/WeakSet where appropriate for caching");
665 console.log(" - Profile with tools like --inspect or clinic.js for production\n");
666
667 } catch (error) {
668 console.error("❌ Memory benchmark failed:", error);
669 process.exit(1);
670 }
671}
672
673main();

Callers 1

memory.jsFile · 0.70

Calls 9

testServerLifecycleFunction · 0.85
testRequestProcessingFunction · 0.85
testParserMemoryFunction · 0.85
testRendererMemoryFunction · 0.85
testRateLimitMemoryFunction · 0.85
testHypermediaMemoryFunction · 0.85
testMemoryLeaksFunction · 0.85
testMemoryPressureFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected