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

Use std::atomic in shared data header #1584

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

snaury
Copy link
Member

@snaury snaury commented Feb 5, 2024

Changelog entry

Use std::atomic in shared data header

Changelog category

  • Improvement

Additional information

This should fix performance issues where TSharedData is more expensive to copy than std::shared_ptr.

@snaury snaury requested a review from kunga February 5, 2024 12:08
Copy link

github-actions bot commented Feb 5, 2024

2024-02-05 12:11:55 UTC Pre-commit check for 3418900 has started.
2024-02-05 12:11:58 UTC Build linux-x86_64-relwithdebinfo is running...
2024-02-05 12:15:05 UTC Check cancelled

Copy link

github-actions bot commented Feb 5, 2024

2024-02-05 12:12:14 UTC Pre-commit check for 3418900 has started.
2024-02-05 12:12:17 UTC Build linux-x86_64-release-asan is running...
2024-02-05 12:15:05 UTC Check cancelled

@snaury snaury force-pushed the use-atomic-in-shared-data branch from 5eb49e1 to da182e0 Compare February 5, 2024 12:14
Copy link

github-actions bot commented Feb 5, 2024

2024-02-05 12:16:11 UTC Pre-commit check for d459d35 has started.
2024-02-05 12:16:12 UTC Build linux-x86_64-release-asan is running...
🟢 2024-02-05 13:00:05 UTC Build successful.
2024-02-05 13:00:19 UTC Tests are running...
🔴 2024-02-05 13:07:19 UTC Test run completed, no test results found for commit da182e0. Please check build logs.
2024-02-05 13:07:22 UTC Check cancelled

Copy link

github-actions bot commented Feb 5, 2024

2024-02-05 12:16:16 UTC Pre-commit check for d459d35 has started.
2024-02-05 12:16:17 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-05 12:57:21 UTC Build successful.
2024-02-05 12:57:35 UTC Tests are running...
🔴 2024-02-05 13:07:18 UTC Test run completed, no test results found for commit da182e0. Please check build logs.
2024-02-05 13:07:21 UTC Check cancelled

@snaury snaury force-pushed the use-atomic-in-shared-data branch from da182e0 to f6af0cd Compare February 5, 2024 13:06
Copy link

github-actions bot commented Feb 5, 2024

2024-02-05 13:09:47 UTC Pre-commit check for 1852382 has started.
2024-02-05 13:09:50 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-05 13:11:59 UTC Build successful.
2024-02-05 13:12:13 UTC Tests are running...
🔴 2024-02-05 14:52:14 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
58878 49575 0 1 9263 39

Copy link

github-actions bot commented Feb 5, 2024

2024-02-05 13:12:13 UTC Pre-commit check for 1852382 has started.
2024-02-05 13:12:16 UTC Build linux-x86_64-release-asan is running...
🟢 2024-02-05 13:14:28 UTC Build successful.
2024-02-05 13:14:41 UTC Tests are running...
🔴 2024-02-05 14:55:46 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14548 14455 0 10 49 34

@snaury snaury marked this pull request as ready for review February 5, 2024 14:30
Copy link
Member

@kunga kunga left a comment

Choose a reason for hiding this comment

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

Now copying of TSharedData works the same time as std::shared_ptr<TString>:

-------------------------------------------------------------|-------------   
Benchmark                                          Before    |    After    
-------------------------------------------------------------|------------- 
TPartIndexSeekFixture/PassIndexPage/0/0            0.018 us  |    0.013 us    
TPartIndexSeekFixture/PassIndexPage/1/0            0.013 us  |    0.013 us 

Full benchmarks results https://gist.github.com/kunga/02e7e9db74b09801774010cdc0cf1e2b

@snaury snaury merged commit a9e6ce0 into ydb-platform:main Feb 6, 2024
2 of 4 checks passed
@snaury snaury deleted the use-atomic-in-shared-data branch February 6, 2024 09:40
@vitstn vitstn mentioned this pull request Feb 6, 2024
vporyadke pushed a commit to vporyadke/ydb that referenced this pull request Feb 9, 2024
@starlinskiy starlinskiy mentioned this pull request Feb 12, 2024
@serbel324 serbel324 mentioned this pull request Feb 13, 2024
@vitstn vitstn mentioned this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants