Skip to content

Draft: Improve bash script generator performance

Arran Walker requested to merge ajwalker/bash-generate-allocs into main

What does this MR do?

  • Reduces allocations in bash's GenerateScript():
    • Removes fmt.Sprintf use and uses strconv.Quote directly where needed (on path names).
    • Uses WriteString() in a loop with space separators rather using strings.Join.
  • Reuses buffers for escape when POSIX/ANSI-C escaping mode is enabled.

Why was this MR needed?

I don't think the readability suffers from the changes and we cut some overhead.

What's the best way to test this MR?

Running a job should still work the same.

What are the relevant issue numbers?

Edited by Arran Walker

Merge request reports