Skip to content

Conversation

eddy16112
Copy link
Contributor

@eddy16112 eddy16112 commented Sep 26, 2025

This PR adds a unit benchmark using google benchmark for the supports_path of the remote channel. We can kind of use it to reproduce the realm regression we had before. Here is some performance data on my workstation with release build:

Without the fix:

----------------------------------------------------------------------------------
Benchmark                                        Time             CPU   Iterations
----------------------------------------------------------------------------------
RemoteChannelFixture/BenchSupportsChannel      24946 ns        24946 ns        27490

With the fix:

------------------------------------------------------------------------------------
Benchmark                                          Time             CPU   Iterations
------------------------------------------------------------------------------------
RemoteChannelFixture/BenchSupportsChannel      16575 ns        16575 ns        42257

Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.23%. Comparing base (fedd6a3) to head (6881526).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #315      +/-   ##
==========================================
+ Coverage   26.62%   27.23%   +0.61%     
==========================================
  Files         188      190       +2     
  Lines       39015    39530     +515     
  Branches    14155    14428     +273     
==========================================
+ Hits        10388    10767     +379     
- Misses      27222    27882     +660     
+ Partials     1405      881     -524     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

int num_channels{100};
};

BENCHMARK_F(RemoteChannelFixture, BenchSupportsChannel)(benchmark::State& state) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we planning to run this as a part of Q/A test suite?

uint64_t best_time = 0;
Realm::XferDesKind best_kind = Realm::XferDesKind::XFER_NONE;
for (int i = 0; i < num_channels; i++) {
best_time = channels[i]->supports_path(channel_copy_infos[i], 0, 0, 0, 10000, nullptr, nullptr, &best_kind, nullptr, nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: please document all hard-coded values that you are passing.

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.

2 participants