Skip to content
Snippets Groups Projects
Select Git revision
  • master default
  • fj-add-build-proxies
  • syscall
  • 3755-helper-image-for-windows-container-execution
  • 3983-runner-ability-to-fetch-prospective-merge-pipelines
  • add-retryable-err-type
  • mr-origin-1164
  • 3755-helper-image-for-windows-container-execution-dockerfiles
  • 11-8-stable
  • 3973-docs-feedback-run-runner-on-kubernetes
  • fix/process-killing-bug
  • prepare-build-current-docker-make-target
  • 3366-temporary-fix-for-lfs-clone-failure
  • docs-make-shell-selection-clear
  • 3755-helper-image-for-windows-container-execution-publish-windows-images
  • rework-git-init
  • mask-trace
  • update-git-lfs-on-helper-image
  • 3755-helper-image-for-windows-container-execution-update-make-file
  • docs/add-windows-deveopment-guidelines
  • v11.8.0
  • v11.8.0-rc1
  • v11.7.0
  • v11.6.1
  • v11.7.0-rc1
  • v11.6.0
  • v11.6.0-rc1
  • v11.5.1
  • v11.5.0
  • v11.5.0-rc1
  • v11.4.2
  • v11.4.1
  • v11.3.2
  • v11.2.2
  • v11.4.0
  • v11.4.0-rc1
  • v11.3.1
  • v11.2.1
  • v11.1.1
  • v11.3.0
40 results

shell_escape.go

Forked from GitLab.org / gitlab-runner
Source project has a limited visibility.
  • Nick Thomas's avatar
    8ea124b6
    Add a benchmark for helpers.ShellEscape and optimise it · 8ea124b6
    Nick Thomas authored
    The improvement is 4 (430 to 0.02 seconds) orders of magnitude, and
    particularly affects large files specified with the `tls-ca-file` configuration
    variable.
    
    The problem was successive string allocations - the for { out += oneChar }
    pattern is death to any garbage collector, and there are several allocations
    per byte as well(!)
    
    Switching to a `bytes.Buffer` for output (conservatively set to 2x the size of
    the input string) and avoiding most addtional allocations and calls to
    `fmt.Sprintf` is super-helpful.
    8ea124b6
    History
    Add a benchmark for helpers.ShellEscape and optimise it
    Nick Thomas authored
    The improvement is 4 (430 to 0.02 seconds) orders of magnitude, and
    particularly affects large files specified with the `tls-ca-file` configuration
    variable.
    
    The problem was successive string allocations - the for { out += oneChar }
    pattern is death to any garbage collector, and there are several allocations
    per byte as well(!)
    
    Switching to a `bytes.Buffer` for output (conservatively set to 2x the size of
    the input string) and avoiding most addtional allocations and calls to
    `fmt.Sprintf` is super-helpful.