Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Merge requests
  • !2340

Improve jar/zip creation performance

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Mike Kaplinskiy requested to merge github/fork/mikekap/jar-file-perf into master Nov 11, 2019
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 2
  • For large jar files, free the per-entry buffer so it can be GC'ed.
  • Get rid of some unnecessary array copies. IMO it might be nice to wrap the entire OutputStream passed to EntryAccounting in a CountingOutputStream and just stop returning bytes written everywhere.
  • Increase the buffer size per entry to 8k and per file to 512k. The former shouldn't hurt since only one entry is live at a time per file (due to the first change). In total you would expect just around 520k of ram usage per file. Previously this would be somewhat unbounded, but for a zip file with 50k entries (this is Buck's jar) it would keep 8kb file buffer + 50000 * 1kb entry buffers - so around 50 megs. The actual build time for Buck's main jar is about the same, but if you build several large uberjars in parallel, there's fewer OOMs.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mikekap/jar-file-perf