Writing data might be done in goroutines. Each field we add is encoded and possibly compressed individually. This can be done on the background inside a goroutine. The call to add is then not blocking, we just need to ensure that data that we pass in does not change before it is captured?
A variation might be to run each addition inside Add(...) as a separate routine. Then Add(a, b, c...) will run side-by-side, while we still wait on Add to finish before proceeding.
Writing data might be done in goroutines. Each field we add is encoded and possibly compressed individually. This can be done on the background inside a goroutine. The call to
addis then not blocking, we just need to ensure that data that we pass in does not change before it is captured?A variation might be to run each addition inside
Add(...)as a separate routine. ThenAdd(a, b, c...)will run side-by-side, while we still wait onAddto finish before proceeding.