Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] Binary Encoding: Adds performance tests with binary encoding enabled. #4911

Closed

Conversation

aavasthy
Copy link
Contributor

@aavasthy aavasthy commented Nov 27, 2024

Description

Add performance tests for methods CreateItemAsync, CreateItemStreamAsync, ReadItemAsync, ReadItemStreamAsync, UpsertItemAsync, UpsertItemStreamAsync, ReplaceItemAsync, ReplaceItemStreamAsync, DeleteItemAsync, DeleteItemStreamAsync which have binary encoding support. These tests will run in the pipeline and help determine in determining regression when binary encoding feature is enabled.
https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build/results?buildId=52826&view=logs&j=aa2fd561-a338-5537-45ee-49ae22aea958&t=65500a81-e1c7-5931-1116-cabb8c832591
image

Type of change

  • New feature (non-breaking change which adds functionality)

Closing issues

To automatically close an issue: closes #IssueNumber

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!

@aavasthy aavasthy changed the title [Internal] Binary Encoding: Add performance tests with binary encoding enabled. [Internal] Binary Encoding: Adds performance tests with binary encoding enabled. Dec 3, 2024
@aavasthy aavasthy marked this pull request as ready for review December 16, 2024 21:37
private MockedItemBenchmarkHelper benchmarkHelper;
private Container container;

[Params(true)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have it run with both true and false to see the impact of enabling it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code path when binary encoding is set to false is covered by existing MockedItemBenchmark.cs. But I can include false parameter here also if it adds more clarity.

[Params(true, false)]
public bool EnableBinaryResponseOnPointOperations;

[GlobalSetup]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is GlobalCleanup needed?

[MemoryDiagnoser]
[BenchmarkCategory("GateBenchmark")]
[Config(typeof(BinaryEncodingEnabledBenchmark.CustomBenchmarkConfig))]
public class BinaryEncodingEnabledBenchmark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to model it as a param on existing Benchmark? (To avoid code duplication)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or derive from existing ItemBenchmark tests?

@@ -90,5 +90,25 @@
"MockedItemBulkBenchmark.UpsertItem;[Type=OfTWithClientMetricsEnabled]": "1206121.5",
"MockedItemBulkBenchmark.UpsertItem;[Type=OfTWithDiagnosticsToString]": "1204822",
"MockedItemBulkBenchmark.UpsertItem;[Type=OfTWithDistributedTracingEnabled]": "1208600.25",
"MockedItemBulkBenchmark.UpsertItem;[Type=Stream]": "768928.75"
"MockedItemBulkBenchmark.UpsertItem;[Type=Stream]": "768928.75",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values are same for both binary and non-binary flow correct ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes keeping the same values for all point operations for both binary encoding flag enabled and disabled.

@aavasthy aavasthy closed this Dec 27, 2024
@aavasthy aavasthy deleted the users/aavasthy/binary_encoding_update_perf_test branch December 27, 2024 23:14
@aavasthy
Copy link
Contributor Author

Please review this PR #4943 for performance tests.
The approach for adding performance tests for Binary encoding feature has changed and instead of adding a new test class, will be updating existing tests to run for scenarios when binary encoding is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants