Files
hakorune/local_tests/test_kilo_memory_simple.nyash
Moe Charm ef7a0de3b0 feat: Prepare for code modularization and cleanup
- Archive old documentation and test files to `docs/archive/` and `local_tests/`.
- Remove various temporary and old files from the project root.
- Add `nekocode-rust` analysis tool and its output files (`nekocode/`, `.nekocode_sessions/`, `analysis.json`).
- Minor updates to `apps/chip8_nyash/chip8_emulator.nyash` and `local_tests` files.

This commit cleans up the repository and sets the stage for further code modularization efforts, particularly in the `src/interpreter` and `src/parser` modules, based on recent analysis.
2025-08-16 01:30:39 +09:00

48 lines
1.9 KiB
Plaintext

// 🧪 Kilo Memory Efficiency Simple Test - Phase 10 Feature Verification
static box Main {
init { console }
main() {
me.console = new ConsoleBox()
me.console.log("🧪 Phase 10 Kilo Memory Test")
// Simple text buffer simulation
local buffer = new ArrayBox()
me.console.log("📊 Created empty buffer")
// Test 1: Add some text
buffer.push("Hello World")
buffer.push("Second Line")
me.console.log("✅ Added 2 lines: " + buffer.length() + " total")
// Test 2: Memory monitoring simulation
local line_count = buffer.length()
local estimated_memory = line_count * 20 // Simple estimation
me.console.log("📈 Estimated memory: " + estimated_memory + " bytes")
// Test 3: "Accidental full copy" simulation
local old_memory = estimated_memory
buffer.push("This is a much longer line that might cause memory issues if copied inefficiently")
local new_line_count = buffer.length()
local new_memory = new_line_count * 20
local memory_growth = new_memory - old_memory
me.console.log("📊 Memory growth: " + old_memory + " -> " + new_memory + " (+"+memory_growth+")")
if (memory_growth > 100) {
me.console.log("⚠️ Large memory growth detected! Possible inefficient copy")
} else {
me.console.log("✅ Memory growth within normal range")
}
// Test 4: Operation counting
local operation_count = 3 // We did 3 push operations
local memory_per_op = new_memory / operation_count
me.console.log("📈 Average memory per operation: " + memory_per_op + " bytes")
me.console.log("🎉 Phase 10 Kilo memory efficiency test complete!")
return "Kilo memory test finished"
}
}