Skip to content

refactor: modernize Process API and add SIMD optimizations#24

Open
renich wants to merge 2 commits into
amberframework:mainfrom
renich:feature/modernize-process-simd
Open

refactor: modernize Process API and add SIMD optimizations#24
renich wants to merge 2 commits into
amberframework:mainfrom
renich:feature/modernize-process-simd

Conversation

@renich

@renich renich commented Jun 11, 2026

Copy link
Copy Markdown

refactor: modernize Process API and add SIMD optimizations

Phase 2:

  • Refactored Process.run and Process.new calls in helpers.cr and
    process_runner.cr to eliminate shell: true and use the RFC 0025 typed
    Process API, preventing shell injections.
  • Implemented LRU Cache boundaries on @@cache in ai_transformer.cr
    with a MAX_CACHE_SIZE of 1000 to prevent memory leaks in persistent instances.
  • Removed unused shell: true flag in database.cr seed invocation.

Phase 3:

  • Applied @[TargetFeature("+avx2")] to the high-frequency string
    parsing methods in AmberCLI::Vendor::Inflector to accelerate regex and
    string operations.

Co-developed-by: Gemini AI renich+gemini@woralelandia.com
Signed-off-by: Rénich Bon Ćirić renich@woralelandia.com

renich added 2 commits June 11, 2026 01:21
Phase 2:
- Refactored `Process.run` and `Process.new` calls in `helpers.cr` and
  `process_runner.cr` to eliminate `shell: true` and use the RFC 0025 typed
  Process API, preventing shell injections.
- Implemented LRU Cache boundaries on `@@cache` in `ai_transformer.cr`
  with a `MAX_CACHE_SIZE` of 1000 to prevent memory leaks in persistent instances.
- Removed unused `shell: true` flag in `database.cr` seed invocation.

Phase 3:
- Applied `@[TargetFeature("+avx2")]` to the high-frequency string
  parsing methods in `AmberCLI::Vendor::Inflector` to accelerate regex and
  string operations.

Co-developed-by: Gemini AI <renich+gemini@woralelandia.com>
Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
Remove unnecessary and platform-unfriendly `@[TargetFeature("+avx2")]` annotations from inflector helper methods.

Co-developed-by: Gemini AI <renich+gemini@woralelandia.com>
Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
@renich

renich commented Jun 12, 2026

Copy link
Copy Markdown
Author

Hello! I have updated the PR to remove the @[TargetFeature("+avx2")] annotations.

I apologize for the oversight regarding @[TargetFeature("+avx2")] and the assumptions about LLVM's autovectorizer on heap-allocated objects and its warnings on ARM64. You are completely right, and I appreciate you calling this out. We will ensure we construct and verify benchmarks before proposing compile-time micro-optimizations in the future.

Co-developed-by: Gemini AI renich+gemini@woralelandia.com
Signed-off-by: Rénich Bon Ćirić renich@woralelandia.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant