-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[cxx-interop] Add benchmark for std::set conversion to a Swift collection #62648
Conversation
@swift-ci please smoke test |
@swift-ci please benchmark |
what exactly are you benchmarking here, the cast from set to Array, or the Array iteration? |
@hyp the intention is to benchmark the Array initializer, I added a for-in loop to make sure that it's not removed by the optimizer. Do you know a better way to benchmark this? |
f563401
to
eaa8689
Compare
You should just put the constructed array value into the |
I haven't thought of this, thanks! |
bec725c
to
ea07771
Compare
ea07771
to
fff5b04
Compare
std::set
iteration3ed77f4
to
35948d4
Compare
185423f
to
32cc95b
Compare
@swift-ci please benchmark |
32cc95b
to
3311d98
Compare
@swift-ci please benchmark |
@swift-ci please smoke test |
3311d98
to
f931de8
Compare
@swift-ci please benchmark |
@swift-ci please smoke test |
[r.mem_pages for r in i_series if r.mem_pages is not None] | ||
for i_series in [select(measurements, num_iters=i) for i in [1, 2]] | ||
] | ||
memory_uses = [m for m in memory_uses if m] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbkka could you please take a look at this part of the PR? This fixes a TypeError
that was thrown out of this Python code when memory_uses
is either empty or only contains empty elements.
cc @shahmishal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
This adds a benchmark for the C++ stdlib overlay functionality that converts C++ containers to Swift collections.
This also fixes a Python exception in the benchmarking engine that happened when no memory measurements were taken for a particular benchmark