Before entries can be masked out, or filtered by shard, an initial set of oplog entry metadata needs to be processed. This is currently done via the rawOplogEntry type which is populated using bson.Unmarshal(), but this is much slower compared to accessing the necessary properties directly using bson methods. Additionally, the namespace entry can be accessed before anything else, so that filtering can happen as far upstream as possible.
Benchmarking shows that small entries are 2x as fast, while the largest entries can be 100x faster.
Before entries can be masked out, or filtered by shard, an initial set of oplog entry metadata needs to be processed. This is currently done via the rawOplogEntry type which is populated using bson.Unmarshal(), but this is much slower compared to accessing the necessary properties directly using bson methods. Additionally, the namespace entry can be accessed before anything else, so that filtering can happen as far upstream as possible.
Benchmarking shows that small entries are 2x as fast, while the largest entries can be 100x faster.