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

BTreeIndex Iterator Remove single run optimization #995

Merged
merged 5 commits into from
Jan 17, 2024

Conversation

kunga
Copy link
Member

@kunga kunga commented Jan 15, 2024

Seek benchmarks yag test -r -F benchmark::TPartIndexIteratorFixture/DoReads/*/0/0/*/*/1

(TPartIndexIteratorFixture/DoReads/b-tree/groups=0/history=0/reverse/ESeek/items=1)

Before:

----------------------------------------------------------------------------------------
Benchmark                                              Time             CPU   Iterations
----------------------------------------------------------------------------------------
TPartIndexIteratorFixture/DoReads/0/0/0/0/1/1       18.8 us         7.74 us        89449
TPartIndexIteratorFixture/DoReads/1/0/0/0/1/1       7.41 us         7.39 us        93294
TPartIndexIteratorFixture/DoReads/0/0/0/1/1/1       7.42 us         7.21 us        98974
TPartIndexIteratorFixture/DoReads/1/0/0/1/1/1       7.58 us         7.57 us        93598
TPartIndexIteratorFixture/DoReads/0/0/0/0/2/1       8.22 us         6.94 us       104775
TPartIndexIteratorFixture/DoReads/1/0/0/0/2/1       8.43 us         7.26 us        96510
TPartIndexIteratorFixture/DoReads/0/0/0/1/2/1       12.5 us         7.20 us       105019
TPartIndexIteratorFixture/DoReads/1/0/0/1/2/1       7.14 us         7.13 us        96782
TPartIndexIteratorFixture/DoReads/0/0/0/0/3/1       13.6 us         7.58 us        88728
TPartIndexIteratorFixture/DoReads/1/0/0/0/3/1       9.47 us         7.64 us        93685
TPartIndexIteratorFixture/DoReads/0/0/0/1/3/1       9.68 us         6.96 us       102325
TPartIndexIteratorFixture/DoReads/1/0/0/1/3/1       11.0 us         7.05 us        97635

After:

----------------------------------------------------------------------------------------
Benchmark                                              Time             CPU   Iterations
----------------------------------------------------------------------------------------
TPartIndexIteratorFixture/DoReads/0/0/0/0/1/1       11.4 us         7.37 us        94450
TPartIndexIteratorFixture/DoReads/1/0/0/0/1/1       9.49 us         7.77 us        92168
TPartIndexIteratorFixture/DoReads/0/0/0/1/1/1       7.87 us         7.18 us        99113
TPartIndexIteratorFixture/DoReads/1/0/0/1/1/1       9.71 us         7.69 us        86517
TPartIndexIteratorFixture/DoReads/0/0/0/0/2/1       10.2 us         7.37 us        90860
TPartIndexIteratorFixture/DoReads/1/0/0/0/2/1       10.3 us         7.61 us        93749
TPartIndexIteratorFixture/DoReads/0/0/0/1/2/1       7.81 us         6.87 us        96138
TPartIndexIteratorFixture/DoReads/1/0/0/1/2/1       8.95 us         7.36 us        99316
TPartIndexIteratorFixture/DoReads/0/0/0/0/3/1       9.64 us         7.18 us        96818
TPartIndexIteratorFixture/DoReads/1/0/0/0/3/1       11.0 us         7.77 us        95898
TPartIndexIteratorFixture/DoReads/0/0/0/1/3/1       15.1 us         7.36 us       103496
TPartIndexIteratorFixture/DoReads/1/0/0/1/3/1       7.41 us         7.37 us        94385

No differences noticed

Copy link

github-actions bot commented Jan 15, 2024

Note

This is an automated comment that will be appended during run.

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 0208b85.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
59902 50681 0 1 9207 13

🔴 linux-x86_64-release-asan: some tests FAILED for commit 0208b85.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15887 15751 0 23 103 10

@kunga kunga force-pushed the KIKIMR-19521-iter-check-run-bounds branch from 7db9a00 to 0208b85 Compare January 15, 2024 19:02
@kunga kunga marked this pull request as ready for review January 15, 2024 19:03
@kunga kunga requested a review from snaury January 15, 2024 21:37
@@ -176,16 +176,15 @@ namespace NTest {
return index.GetLastRecord();
}

inline const TPartIndexIt::TRecord * GetRecord(const TPartStore& part, TPageId pageId) {
inline const TPartIndexIt::TRecord * GetRecord(const TPartStore& part, TPageId pageIndex) {
Copy link
Member

@snaury snaury Jan 17, 2024

Choose a reason for hiding this comment

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

Очень минорное: немного странное переименование pageId -> pageIndex, ведь индекс это и есть page id.

Copy link
Member Author

@kunga kunga Jan 17, 2024

Choose a reason for hiding this comment

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

pageIndex это типо номер с начала внутри TPart

например TPart из 10 страниц их индексы [0..9]

а pageId могут быть [0, 1, 5, 10, 15, ..

Copy link
Member

Choose a reason for hiding this comment

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

В таком случае использовать TPageId в качестве типа очень странно.

@kunga kunga merged commit 5fa4b2f into main Jan 17, 2024
3 of 5 checks passed
@kunga kunga deleted the KIKIMR-19521-iter-check-run-bounds branch January 22, 2024 12:46
@niksaveliev niksaveliev mentioned this pull request Jan 29, 2024
@vitstn vitstn mentioned this pull request Jan 29, 2024
@starlinskiy starlinskiy mentioned this pull request Feb 12, 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants