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

Create a benchmark for map subscript. #7026

Closed

Conversation

laithsakka
Copy link
Contributor

Summary:

============================================================================
[...]hmarks/ExpressionBenchmarkBuilder.cpp     relative  time/iter   iters/s
============================================================================
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>##1               71.48ms     13.99
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>##2               76.58ms     13.06
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>##3               85.31ms     11.72
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>##4              121.56ms      8.23
map_subscript_MAP<INTEGER,INTEGER>##1                      27.19ms     36.78
map_subscript_MAP<INTEGER,INTEGER>##2                      33.10ms     30.21
map_subscript_MAP<INTEGER,INTEGER>##3                      33.47ms     29.88
map_subscript_MAP<INTEGER,INTEGER>##4                      31.70ms     31.55
map_subscript_MAP<VARCHAR,INTEGER>##1                      26.92ms     37.14
map_subscript_MAP<VARCHAR,INTEGER>##2                      36.62ms     27.31
map_subscript_MAP<VARCHAR,INTEGER>##3                      34.19ms     29.24
map_subscript_MAP<VARCHAR,INTEGER>##4                      33.76ms     29.62

Differential Revision: D50237919

@netlify
Copy link

netlify bot commented Oct 12, 2023

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit f621618
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/652873dab554be0008f28dd5

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Oct 12, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D50237919

Summary:

```
============================================================================
[...]hmarks/ExpressionBenchmarkBuilder.cpp     relative  time/iter   iters/s
============================================================================
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#1               71.48ms     13.99
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#2               76.58ms     13.06
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#3               85.31ms     11.72
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#4              121.56ms      8.23
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#1                      27.19ms     36.78
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#2                      33.10ms     30.21
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#3                      33.47ms     29.88
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#4                      31.70ms     31.55
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#1                      26.92ms     37.14
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#2                      36.62ms     27.31
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#3                      34.19ms     29.24
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#4                      33.76ms     29.62
```

Differential Revision: D50237919
laithsakka added a commit to laithsakka/velox that referenced this pull request Oct 12, 2023
Summary:

```
============================================================================
[...]hmarks/ExpressionBenchmarkBuilder.cpp     relative  time/iter   iters/s
============================================================================
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#1               71.48ms     13.99
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#2               76.58ms     13.06
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#3               85.31ms     11.72
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#4              121.56ms      8.23
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#1                      27.19ms     36.78
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#2                      33.10ms     30.21
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#3                      33.47ms     29.88
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#4                      31.70ms     31.55
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#1                      26.92ms     37.14
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#2                      36.62ms     27.31
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#3                      34.19ms     29.24
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#4                      33.76ms     29.62
```

Differential Revision: D50237919
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D50237919

laithsakka added a commit to laithsakka/velox that referenced this pull request Oct 12, 2023
Summary:

```
============================================================================
[...]hmarks/ExpressionBenchmarkBuilder.cpp     relative  time/iter   iters/s
============================================================================
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#1               71.48ms     13.99
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#2               76.58ms     13.06
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#3               85.31ms     11.72
map_subscript_MAP<ARRAY<VARCHAR>,INTEGER>#facebookincubator#4              121.56ms      8.23
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#1                      27.19ms     36.78
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#2                      33.10ms     30.21
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#3                      33.47ms     29.88
map_subscript_MAP<INTEGER,INTEGER>#facebookincubator#4                      31.70ms     31.55
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#1                      26.92ms     37.14
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#2                      36.62ms     27.31
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#3                      34.19ms     29.24
map_subscript_MAP<VARCHAR,INTEGER>#facebookincubator#4                      33.76ms     29.62
```

Differential Revision: D50237919
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D50237919

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D50237919

auto createSet = [&](const TypePtr& mapType) {
VectorFuzzer::Options options;
options.vectorSize = 1'000;
options.containerLength = 20;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make some variability on this? This is the most important parameter in this case IMO

auto makeKeys = [&](int index) {
DecodedVector decoded(*columns[index - 1]);
auto* map = decoded.base()->as<MapVector>();
auto indices = allocateIndices(1000, pool);
Copy link
Contributor

Choose a reason for hiding this comment

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

everywhere you use 1000 in this lambda, it's because that's the value of options.vectorSize right? could we just use that variable here instead?

VectorFuzzer::Options options;
options.vectorSize = 1'000;
options.containerLength = 20;
options.containerVariableLength = 20;
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't containerVariableLength a bool? this is probably a typo

auto indices = allocateIndices(1000, pool);
auto* mutableIndices = indices->asMutable<vector_size_t>();
for (int i = 0; i < 1000; i++) {
int keyIndex = folly::Random::rand32() % 20;
Copy link
Contributor

Choose a reason for hiding this comment

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

This will mostly produce misses right? Is that intended?

The first 20 elements in mapKeys are likely to be in the first few maps (maybe just the first one). And the keys are not very likely to occur in later maps because of the range the random map keys are pulled from.

I may be misreading/misunderstanding the code.

Copy link

stale bot commented Jan 11, 2024

This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the PR, make sure you've addressed reviewer comments, and rebase on the latest main. Thank you for your contributions!

@stale stale bot added the stale label Jan 11, 2024
@stale stale bot closed this Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants