This repository was archived by the owner on Apr 9, 2025. It is now read-only.
New functionality to allow a pathway for writes with minimal overhead. #133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I've added a new function to allow developers to bypass the not insignificant overheads of (for example) using mongo_batch_insert and have a more direct path to mongo_env_write_socket. This, if used, can make significant savings in overhead by avoiding redundant calls such as memcpy and various other checks.
update: added a new commit with a test for mongo_fast_with_write_concern() and updated the benchmark to provide a comparison between mongo_batch_insert() and mongo_fast_with_write_concern().
Results on my system as follows; I expect with properly tuned network settings the results should be improved further.
serialize_small_test 8,051,529.790660
serialize_medium_test 2,258,355.916893
serialize_large_test 45,062.095568
serialize_small_test_fast 80,645,161.290323
serialize_medium_test_fast 48,076,923.076923
serialize_large_test_fast 124,134.164205
batch_insert_small_test_fast 155,593.589544
batch_insert_medium_test_fast 39,410.109481
batch_insert_large_test_fast 10,624.237711
batch_insert_small_test 34,433.838822
batch_insert_medium_test 47,975.436576
batch_insert_large_test 8,638.025278