Skip to content

Latest commit

 

History

79 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content Defined Chunking playground

This repository provides reference implementations of the RepMaxCDC "Repeated Maximum" Content-Defined Chunking function, which is written in the Go programming language. RepMaxCDC is one of the standard CDC functions of Bazel's remote execution protocol. An implementation written in Java is part of Bazel.

RepMaxCDC provides:

  • Tight chunk size bounds: Most CDC functions generate chunks whose minimum and maximum size are still a factor of 16 or 32 apart. RepMaxCDC is capable of generating chunks with sizes in range $[n, 2n)$, while offering excellent deduplication rates.

  • Excellent parallelism: RepMaxCDC allows performing targeted searches for cutting points. This makes it possible to partition a large file into roughly equally sized pieces. These can be chunked in parallel.

  • Size-based checking: With chunks always falling in range $[n, 2n)$, it is trivial to check whether a file can be split into multiple chunks, purely looking at its size. This property, which other CDC functions often lack, was needed to add support for chunking to Bazel's existing remote execution protocol in a backward compatible way.

Two implementations of RepMaxCDC are included:

Tests are used to validate that both implementations yield the same results.

This repository also contains a copy of a paper titled "Content-Defined Chunking with tight chunk size bounds", which provides a formal description and analysis of RepMaxCDC. It also describes some simpler algorithms on which RepMaxCDC is based: MaxCDC ("Maximum") and RecMaxCDC ("Recursive Maximum"). This paper can be referenced as follows:

@misc{repmaxcdc,
      title = {Content-Defined Chunking with tight chunk size bounds},
      author = {Ed Schouten},
      year = {2026},
      month = aug,
      url = {https://github.com/buildbarn/go-cdc/blob/main/papers/cdc.pdf},
}

About

Content Defined Chunking playground

Resources

Stars

53 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages