ironcode-ai 1.7.0 โ†’ 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +140 -42
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -22,6 +22,43 @@
22
22
 
23
23
  ---
24
24
 
25
+ ## ๐ŸŽ‰ What's New
26
+
27
+ ### February 2026 - Streaming Optimizations
28
+
29
+ **Massive performance and memory improvements through streaming patterns:**
30
+
31
+ #### File Read Optimization
32
+
33
+ - โšก **1.17-1.56x faster** across all file sizes
34
+ - ๐Ÿ’พ **99.7% memory savings** on large files (39MB โ†’ 0.13MB for 100K lines)
35
+ - ๐Ÿ“– 64KB buffer with pre-allocated capacity eliminates reallocation
36
+ - โœ… **100% identical results** - zero breaking changes
37
+
38
+ #### Grep Search Optimization
39
+
40
+ - ๐Ÿ’พ **90-99% memory reduction** when searching large files
41
+ - ๐Ÿ” Stream lines instead of loading entire files
42
+ - โšก Early exit after 1000 matches for efficiency
43
+ - ๐ŸŽฏ Can search **GB-sized files** without running out of memory
44
+ - โœ… **100% identical results** - verified with comprehensive tests
45
+
46
+ **Why streaming matters:**
47
+
48
+ - Search 100 files ร— 1MB each: **100MB โ†’ 10MB memory** usage
49
+ - No data loss - regex matches on full line content before display truncation
50
+ - Scales to much larger codebases on memory-constrained systems
51
+
52
+ ### Previous Updates
53
+
54
+ - **Memory optimization** - 97.6% faster message processing (254ms โ†’ 6ms) - Feb 2026
55
+ - **Resource monitoring** - Automatic throttling with 300MB default limit - Feb 2026
56
+ - **PTY/Terminal native** - 15.29x speedup, powers Bash tool - Feb 2026
57
+ - **Edit tool optimization** - 2-6x faster with 9 smart strategies
58
+ - **Archive extraction** - 3-5x faster with s-zip native
59
+
60
+ ---
61
+
25
62
  ## What is IronCode?
26
63
 
27
64
  IronCode is a **high-performance CLI fork** of [OpenCode](https://github.com/anomalyco/opencode) - an AI coding agent that runs entirely on your machine. This fork focuses on the command-line experience, removes cloud dependencies, and **rewrites performance-critical components in Rust** for dramatically improved speed and efficiency.
@@ -37,6 +74,46 @@ IronCode is a **high-performance CLI fork** of [OpenCode](https://github.com/ano
37
74
 
38
75
  ### ๐Ÿš€ Performance Improvements
39
76
 
77
+ IronCode delivers exceptional performance through **native Rust components** and **intelligent memory management**:
78
+
79
+ #### Memory Efficiency & Resource Monitoring
80
+
81
+ IronCode includes an **automatic resource monitoring system** that keeps memory usage under control:
82
+
83
+ - ๐ŸŽฏ **Default 300MB limit** - Prevents excessive memory consumption
84
+ - ๐Ÿ“Š **Real-time monitoring** - Checks every 5 seconds with three levels (normal/warning/critical)
85
+ - ๐Ÿšฆ **Auto-throttling** - Automatically slows down at 95% memory to prevent crashes
86
+ - โšก **Optimized processing** - 98% faster message handling with selective cloning
87
+ - ๐Ÿ”ง **Configurable** - Adjust limits with `--max-memory` flag or disable with `--no-enable-resource-monitor`
88
+
89
+ **Memory Optimizations:**
90
+
91
+ | Optimization | Impact | Speedup |
92
+ | -------------------------------- | ---------------------- | ------------------------------- |
93
+ | **Selective Message Cloning** | 4.1MB saved per step | 97.6% faster (254ms โ†’ 6ms) |
94
+ | **Array Operation Improvements** | Reduced GC pressure | 7 optimizations across codebase |
95
+ | **Automatic Throttling** | Prevents memory spikes | Active at 285MB (95% threshold) |
96
+
97
+ **Example Usage:**
98
+
99
+ ```bash
100
+ # Default (300MB limit, monitoring enabled)
101
+ ironcode
102
+
103
+ # Custom memory limit
104
+ ironcode --max-memory 500
105
+
106
+ # Disable resource monitoring
107
+ ironcode --no-enable-resource-monitor
108
+
109
+ # Both options
110
+ ironcode --max-memory 400 --enable-resource-monitor
111
+ ```
112
+
113
+ See [RESOURCE-MONITORING.md](./RESOURCE-MONITORING.md) for full documentation.
114
+
115
+ #### Native Rust Performance
116
+
40
117
  IronCode rewrites key operations in native Rust with **measured real-world performance gains**:
41
118
 
42
119
  | Operation | TypeScript/Node | Rust Native | **Speedup** | Notes |
@@ -55,51 +132,55 @@ IronCode rewrites key operations in native Rust with **measured real-world perfo
55
132
  | **File Listing** | 15.80 ms | 11.50 ms | **1.37x faster** | Native ignore crate |
56
133
  | **File Glob (100 files)** | 9.74 ms | 3.55 ms | **2.74x faster** | Zero spawn overhead |
57
134
  | **Grep Search** | 34.84 ms | 19.35 ms | **1.80x faster** | Pattern: "function" |
135
+ | **Grep (streaming)** | N/A | Similar | **90-99% memory** | Can search GB files |
58
136
  | **VCS Info (git)** | 17.25 ms | 9.43 ms | **1.83x faster** | libgit2, no spawning |
59
137
  | **Archive (small, 10)** | 5.48 ms | 1.93 ms | **2.8x faster** | s-zip vs unzip |
60
138
  | **Archive (medium, 100)** | 90.43 ms | 18.07 ms | **5.0x faster** | s-zip vs unzip |
61
139
  | **Archive (large, 500)** | 740.29 ms | 142.88 ms | **5.2x faster** | s-zip vs unzip |
62
- | **Read (500 lines)** | 18 ยตs | 27 ยตs | 0.67x | Raw FFI |
63
- | **Read (1K lines)** | 29 ยตs | 47 ยตs | 0.62x | Raw FFI |
64
- | **Read (5K lines)** | 120 ยตs | 194 ยตs | 0.62x | Raw FFI |
65
- | **Write (1K lines)** | 49 ยตs | 139 ยตs | 0.35x | Raw FFI |
66
- | **Write (5K lines)** | 135 ยตs | 408 ยตs | 0.33x | Raw FFI |
140
+ | **Read (1K lines)** | 0.06 ms | 0.04 ms | **1.50x faster** | 64KB buffer + capacity |
141
+ | **Read (10K lines)** | 0.34 ms | 0.29 ms | **1.17x faster** | Pre-allocation |
142
+ | **Read (50K lines)** | 1.45 ms | 0.97 ms | **1.49x faster** | Streaming optimized |
143
+ | **Read (100K lines)** | 3.71 ms | 2.38 ms | **1.56x faster** | 99.7% memory savings |
144
+ | **Read (500K lines)** | 31.50 ms | 21.55 ms | **1.46x faster** | 30MB file |
67
145
 
68
146
  **Key Insights:**
69
147
 
70
148
  - ๐ŸŽฏ **PTY/Terminal**: **15.29x faster** (exceeded 10x target!) - Native ring buffer, zero-copy reads
149
+ - โœ… **File Read**: **1.17-1.56x faster** with **99.7% memory savings** (39MB โ†’ 0.13MB for 100K lines) - 64KB buffer + pre-allocation
150
+ - โœ… **Grep Search**: **90-99% memory reduction** with streaming - Can search GB-sized files without OOM
71
151
  - โœ… **Edit Tool**: 2-6x faster across all file sizes with all 9 smart replacement strategies
72
152
  - โœ… **Bash Parser**: 50-100x faster using native tree-sitter vs WASM (0.020ms per command, no initialization overhead)
73
153
  - โœ… **Glob/Grep**: 1.8-2.7x faster by eliminating process spawn overhead
74
154
  - โœ… **VCS Info**: 1.83x faster using libgit2 directly (no process spawning, 45% latency reduction)
75
155
  - โœ… **Archive Extraction**: 3-5x faster using s-zip vs shell commands (unzip/PowerShell)
76
- - โš ๏ธ **File I/O**: Raw FFI is 1.5-3x slower than Bun native due to FFI overhead
77
- - ๐Ÿ“Š **Memory**: Equivalent peak heap usage between Rust and Node.js for file I/O
78
- - ๐ŸŽฏ **Lesson**: FFI overhead (~50ยตs) remains; only use Rust when compute > overhead
79
- - ๐Ÿ”ง **Decision**: We use raw Rust FFI for consistency across native tool suite
156
+ - ๐Ÿ“Š **Memory**: Streaming patterns use only 64KB buffer regardless of file size
157
+ - ๐ŸŽฏ **Lesson**: Pre-allocation + streaming + larger buffers = faster I/O with dramatically less memory
80
158
 
81
159
  **Native Rust Components:**
82
160
 
83
161
  - โœ… **PTY/Terminal**: Full terminal session management with 2MB ring buffer, zero-copy streaming (15.29x faster) - Powers all Bash tool operations
162
+ - โœ… **File Reading**: Streaming read with 64KB buffer and pre-allocation (1.2-1.6x faster, 99.7% memory savings)
163
+ - โœ… **Grep Search**: Streaming line-by-line search (90-99% memory reduction, scales to GB files)
84
164
  - โœ… **Edit Tool**: 9 smart replacement strategies with fuzzy matching (complex compute justifies FFI)
85
165
  - โœ… **File Listing**: Native ignore crate for fast directory traversal (eliminates process spawn)
86
166
  - โœ… **File Search (Glob)**: Pattern matching with gitignore support (eliminates process spawn)
87
- - โœ… **Code Search (Grep)**: Regex search across large codebases (eliminates process spawn)
88
167
  - โœ… **Archive Extraction**: ZIP file extraction using s-zip streaming reader (3-5x faster, cross-platform)
89
168
  - โœ… **Bash Parser**: Native tree-sitter bash command parsing (50-100x faster than WASM, 0.020ms per command)
90
- - โœ… **File I/O**: Native read/write with optimized raw FFI
91
169
  - โœ… **Directory Listing**: Fast recursive directory traversal
92
170
  - โœ… **VCS Info**: Lightning-fast git repository information (libgit2 vs subprocess)
93
171
  - โœ… **System Stats**: CPU and memory monitoring
94
172
 
95
173
  **Benefits:**
96
174
 
175
+ - ๐Ÿš€ **1.2-1.6x faster** file reading with 64KB buffer and pre-allocation
176
+ - ๐Ÿ’พ **99.7% memory savings** on large files (39MB โ†’ 0.13MB for 100K lines)
177
+ - ๐Ÿ” **90-99% memory reduction** for grep search - can search GB-sized files
97
178
  - ๐Ÿš€ **Up to 6x faster** text editing with 9 smart replacement strategies (Levenshtein, fuzzy matching)
98
179
  - ๐Ÿš€ **Up to 5x faster** archive extraction (ZIP files) with cross-platform native code
99
180
  - ๐Ÿ’š **83% less time** on large file edits (10K lines: 451ms โ†’ 75ms)
100
181
  - โšก **1.83x faster** git operations using libgit2 (no process spawning)
101
182
  - ๐ŸŽฏ **2-3x faster** glob/grep by eliminating process spawn overhead
102
- - ๐Ÿ“Š **Optimized I/O**: Raw FFI implementation for consistent performance
183
+ - ๐Ÿ“Š **Optimized I/O**: Streaming patterns with single-allocation for minimal memory footprint
103
184
  - ๐Ÿ”ง **Consistent tooling**: Native Rust across all file operations for predictable performance
104
185
  - ๐ŸŒ **Cross-platform**: No external dependencies (unzip/PowerShell) for archive extraction
105
186
 
@@ -126,12 +207,16 @@ IronCode rewrites key operations in native Rust with **measured real-world perfo
126
207
  **Enhanced:**
127
208
 
128
209
  - ๐Ÿš€ **Native Rust performance** for compute-heavy operations (2-6x faster)
210
+ - ๐Ÿ’พ **Streaming file reads** with 99.7% memory savings (1.2-1.6x faster)
129
211
  - โšก **Eliminated process spawns** for glob/grep (2-3x speedup)
130
212
  - ๐Ÿ—œ๏ธ **Fast archive extraction** with s-zip (3-5x faster, cross-platform native)
131
213
  - ๐Ÿ’š **Faster edits** (2-6x improvement, scales with file size)
132
214
  - ๐Ÿ”ฅ **Smart edit strategies** with fuzzy matching and Levenshtein similarity
133
- - ๐Ÿ“Š **Optimized I/O**: Raw FFI implementation for consistent performance
215
+ - ๐Ÿ“Š **Optimized I/O**: Streaming read with 64KB buffer and pre-allocation
134
216
  - ๐Ÿ”ง **Consistent native tooling**: All file operations use Rust for predictable performance
217
+ - ๐ŸŽฏ **Memory efficiency**: Automatic resource monitoring with 300MB default limit
218
+ - ๐Ÿšฆ **Auto-throttling**: Prevents memory spikes and system crashes
219
+ - โšก **98% faster message processing**: Selective cloning optimization (254ms โ†’ 6ms)
135
220
 
136
221
  ---
137
222
 
@@ -151,20 +236,36 @@ npx ironcode-ai
151
236
 
152
237
  ### Homebrew (macOS/Linux)
153
238
 
239
+ IronCode is available through a Homebrew tap. The formula automatically installs the appropriate binary for your platform.
240
+
154
241
  ```bash
155
242
  # Add the tap
156
- brew tap KSD-CO/tap
243
+ brew tap KSD-CO/tap https://github.com/KSD-CO/homebrew-tap
157
244
 
158
245
  # Install IronCode
159
246
  brew install ironcode
160
247
 
248
+ # Verify installation
249
+ ironcode --version
250
+
161
251
  # Update to latest version
162
252
  brew upgrade ironcode
163
253
  ```
164
254
 
165
- ### Direct Download
255
+ **Supported Platforms:**
256
+
257
+ - macOS (Intel x64)
258
+ - macOS (Apple Silicon arm64)
259
+ - Linux (x64)
260
+ - Linux (arm64)
261
+
262
+ The Homebrew formula is auto-generated from releases and maintained at [github.com/KSD-CO/homebrew-tap](https://github.com/KSD-CO/homebrew-tap/blob/main/ironcode.rb).
263
+
264
+ ### Direct Download (Standalone Binary)
166
265
 
167
- Download pre-built binaries for your platform from [GitHub Releases](https://github.com/KSD-CO/IronCode/releases):
266
+ For users who prefer not to use package managers, download the pre-built CLI binary directly from [GitHub Releases](https://github.com/KSD-CO/IronCode/releases).
267
+
268
+ These are **standalone executables** that require no additional installation - just download, extract, and run:
168
269
 
169
270
  **Linux (x64):**
170
271
 
@@ -231,6 +332,12 @@ _Coming soon - AUR package will be available in the future_
231
332
  # Start interactive session in current directory
232
333
  ironcode
233
334
 
335
+ # Run with custom memory limit (default: 300MB)
336
+ ironcode --max-memory 500
337
+
338
+ # Run without resource monitoring
339
+ ironcode --no-enable-resource-monitor
340
+
234
341
  # Run with specific model
235
342
  ironcode --model anthropic/claude-sonnet-4
236
343
 
@@ -327,6 +434,16 @@ bun run typecheck
327
434
  # Format code (using prettier)
328
435
  bun run format
329
436
 
437
+ # Resource monitoring tests
438
+ cd packages/ironcode
439
+ bun test test/resource.test.ts # Unit tests
440
+ bun test test/resource-monitor.test.ts # Allocation test
441
+ bun test test/resource-integration.test.ts # Server integration
442
+ bun --expose-gc test/clone-optimization.test.ts # Clone comparison
443
+ bun test test/stress-test.ts # Light load test
444
+ bun test test/heavy-test.ts # Heavy file ops
445
+ bun test test/extreme-test.ts # Conversation simulation
446
+
330
447
  # Benchmark native Rust components
331
448
  cd packages/ironcode/native/tool
332
449
  cargo bench
@@ -412,6 +529,10 @@ Contributions are welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) befo
412
529
 
413
530
  **Recent Contributions:**
414
531
 
532
+ - โœ… **Streaming read optimization** (1.2-1.6x faster, 99.7% memory savings - Feb 2026)
533
+ - โœ… **Grep streaming optimization** (90-99% memory reduction, GB-file capability - Feb 2026)
534
+ - โœ… **Memory optimization deployed to production** (97.6% faster message processing - Feb 2026)
535
+ - โœ… **Resource monitoring system** (automatic throttling, 300MB default limit - Feb 2026)
415
536
  - โœ… **Native PTY/Terminal deployed to production** (15.29x speedup, powers Bash tool - Feb 2026)
416
537
  - โœ… Native Rust edit tool with 9 strategies (3-4x speedup)
417
538
  - โœ… File Watcher Rust infrastructure (ready but not integrated - @parcel/watcher already native)
@@ -448,6 +569,9 @@ bun ./script/test-integration.ts # Integration tests
448
569
  # PTY/Terminal benchmark (15.29x speedup)
449
570
  bun script/bench-pty.ts
450
571
 
572
+ # File read benchmark (1.2-1.6x speedup, 99.7% memory savings)
573
+ # See STREAMING-READ-OPTIMIZATION.md for details
574
+
451
575
  # Rust micro-benchmarks
452
576
  cd packages/ironcode/native/tool
453
577
  cargo bench --bench edit_bench
@@ -492,33 +616,7 @@ _Benchmarked on IronCode repository (dev branch, 100 iterations)_
492
616
 
493
617
  ---
494
618
 
495
- ## Upstream Sync
496
-
497
- This fork periodically syncs with [upstream OpenCode](https://github.com/anomalyco/opencode) to incorporate new features and bug fixes.
498
-
499
- ```bash
500
- # To sync with upstream
501
- git remote add upstream https://github.com/anomalyco/opencode.git
502
- git fetch upstream
503
- git merge upstream/dev
504
- ```
505
-
506
- ---
507
-
508
- ## License
509
-
510
- This project maintains the same license as [OpenCode](https://github.com/anomalyco/opencode).
511
-
512
- ---
513
-
514
619
  ## Acknowledgments
515
620
 
516
621
  - **OpenCode Team**: For creating the original open-source AI coding agent
517
622
  - All contributors to this fork
518
-
519
- ---
520
-
521
- ## Links
522
-
523
- - [Upstream OpenCode](https://github.com/anomalyco/opencode)
524
- - [IronCode Documentation](https://ironcode.cloud/docs)
package/package.json CHANGED
@@ -6,11 +6,11 @@
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "1.7.0",
9
+ "version": "1.9.0",
10
10
  "license": "MIT",
11
11
  "optionalDependencies": {
12
- "ironcode-darwin-arm64": "1.7.0",
13
- "ironcode-windows-x64": "1.7.0",
14
- "ironcode-linux-x64": "1.7.0"
12
+ "ironcode-darwin-arm64": "1.9.0",
13
+ "ironcode-windows-x64": "1.9.0",
14
+ "ironcode-linux-x64": "1.9.0"
15
15
  }
16
16
  }