Skip to content

[#14] Optimize TypeElementCompiler for CSharp if TypeElement not have Generics#20

Merged
fembina merged 2 commits into
mainfrom
14-optimize-type-element-compiler-for-csharp-if-type-element-not-have-generics
Jun 7, 2026
Merged

[#14] Optimize TypeElementCompiler for CSharp if TypeElement not have Generics#20
fembina merged 2 commits into
mainfrom
14-optimize-type-element-compiler-for-csharp-if-type-element-not-have-generics

Conversation

@fembina

@fembina fembina commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@fembina fembina added this to the Release v0.2.0 milestone Jun 7, 2026
@fembina fembina self-assigned this Jun 7, 2026
Copilot AI review requested due to automatic review settings June 7, 2026 23:31
@fembina fembina linked an issue Jun 7, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the C# TypeElementCompiler to reduce per-call work when compiling type names (especially when no generic arguments are present) by precomputing constant lengths and simplifying generic-type branching.

Changes:

  • Precompute the combined < and > length (LeftRightAngleBracketsLength) to avoid recomputing bracket lengths during compilation.
  • Add checked(...) to the initial typeLength computation and refactor generic handling with a hasGenericTypes flag.
  • Avoid storing angle bracket constants in locals; append them directly from CSharpLanguageConstants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/Falko.Foundry.CSharp/Compilers/TypeElementCompiler.cs
… importand to check only if value can be less to 0 and affect math operations
@fembina fembina merged commit d107977 into main Jun 7, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in foundry-workflow Jun 7, 2026
@fembina fembina deleted the 14-optimize-type-element-compiler-for-csharp-if-type-element-not-have-generics branch June 7, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Optimize TypeElementCompiler for CSharp if TypeElement not have Generics

2 participants