Skip to content

Conversation

@watany-dev
Copy link
Owner

  • Use strings.Builder instead of += concatenation in benchmark test
  • Pre-allocate slices with known capacity in ParsePathFile,
    extractJobOrderFromNode, and DiscoverWorkflows
  • Use strings.EqualFold for case-insensitive comparison instead of
    strings.ToLower to avoid unnecessary string allocations

These changes reduce memory allocations and improve performance by:

  • Avoiding O(n²) string concatenation in loops
  • Reducing slice reallocations during append operations
  • Eliminating temporary string allocations for case comparison

- Use strings.Builder instead of += concatenation in benchmark test
- Pre-allocate slices with known capacity in ParsePathFile,
  extractJobOrderFromNode, and DiscoverWorkflows
- Use strings.EqualFold for case-insensitive comparison instead of
  strings.ToLower to avoid unnecessary string allocations

These changes reduce memory allocations and improve performance by:
- Avoiding O(n²) string concatenation in loops
- Reducing slice reallocations during append operations
- Eliminating temporary string allocations for case comparison
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.

2 participants