Skip to content

add benchmark of set isStrictSubset #23690

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

Merged
merged 6 commits into from
Apr 17, 2019

Conversation

Gumichocopengin8
Copy link
Contributor

@Gumichocopengin8 Gumichocopengin8 commented Mar 30, 2019

Add isStrictSubset benchmark of Set because benchmark of isStrictSubset is not written yet.

SetIsStrictSubsetBox25 and SetIsStrictSubsetBox25 could not compile it, so I commented them out.

@lorentey
Copy link
Member

lorentey commented Apr 1, 2019

@swift-ci benchmark

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

Thanks, these will be handy. The changes look good, but please add the boxed variants, too!

@swift-ci

This comment has been minimized.

@lorentey
Copy link
Member

lorentey commented Apr 1, 2019

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Apr 1, 2019

Build failed before running benchmark.

@Gumichocopengin8
Copy link
Contributor Author

@swift-ci benchmark

1 similar comment
@lorentey
Copy link
Member

lorentey commented Apr 2, 2019

@swift-ci benchmark

@lorentey
Copy link
Member

lorentey commented Apr 2, 2019

@Gumichocopengin8 swift-ci only listens to people with commit access -- but we're happy to trigger tests as needed!

@lorentey
Copy link
Member

lorentey commented Apr 2, 2019

@swift-ci please smoke test

@lorentey
Copy link
Member

lorentey commented Apr 2, 2019

Looks good!

The bot will analyze benchmarks and it will complain if some tests take too long; if that's the case, those need to be fixed before we merge this.

@Gumichocopengin8
Copy link
Contributor Author

@lorentey
Thank you! I'm happy to contribute to swift. I am going to contribute more.
I think it is a good start for GSoC.

@lorentey
Copy link
Member

lorentey commented Apr 8, 2019

@swift-ci benchmark

@Gumichocopengin8
Copy link
Contributor Author

Do I still need to fix something to run benchmark without error?

@lorentey
Copy link
Member

lorentey commented Apr 9, 2019

Hm; it looks like it failed while running the original benchmarks. Let's try again!

@swift-ci please benchmark

@Gumichocopengin8
Copy link
Contributor Author

I don't know why it failed.
Does it sometimes happen?

@lorentey
Copy link
Member

It may have something to do with the new benchmarks -- benchmarking does not fail for other PRs. I'll take a look in a local build.

@Gumichocopengin8
Copy link
Contributor Author

Thank you.
I'll work on other issues.

@lorentey
Copy link
Member

There is indeed an issue with SetIsStrictSubsetInt100:

...
637,SetIsStrictSubsetBox0,1,583,583,583,0,583
638,SetIsStrictSubsetBox25,1,297,297,297,0,297
639,SetIsStrictSubsetInt0,1,1040,1040,1040,0,1040
Incorrect result in run_SetIsStrictSubsetInt(_:_:_:_:), [...]/swift/benchmark/single-source/SetTests.swift:385

@Gumichocopengin8, could you please fix the expected value and double check there aren't any other issues by running the benchmarks on your system?

@Gumichocopengin8
Copy link
Contributor Author

OK!
I'll fix it and double check the benchmark on my Mac.

@Gumichocopengin8
Copy link
Contributor Author

I fixed the error and triple checked.
It must work well now :)

@lorentey
Copy link
Member

@swift-ci benchmark

@lorentey
Copy link
Member

@swift-ci smoke test

@swift-ci
Copy link
Contributor

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
ObjectiveCBridgeStubFromNSDateRef 4060 4370 +7.6% 0.93x (?)
Improvement
CharacterLiteralsLarge 108 97 -10.2% 1.11x
Added
Set.isStrictSubset.Empty.Int 170 172 171
Set.isStrictSubset.Int.Empty 90 92 91
SetIsStrictSubsetBox0 381 381 381
SetIsStrictSubsetBox25 164 168 165
SetIsStrictSubsetInt0 265 267 266
SetIsStrictSubsetInt100 599 633 614
SetIsStrictSubsetInt25 78 80 79
SetIsStrictSubsetInt50 154 156 155

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
SetTests.o 72118 79574 +10.3% 0.91x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
CharacterLiteralsLarge 100 111 +11.0% 0.90x (?)
Added
Set.isStrictSubset.Empty.Int 180 183 181
Set.isStrictSubset.Int.Empty 100 101 100
SetIsStrictSubsetBox0 375 375 375
SetIsStrictSubsetBox25 255 259 256
SetIsStrictSubsetInt0 268 271 269
SetIsStrictSubsetInt100 590 592 591
SetIsStrictSubsetInt25 75 76 75
SetIsStrictSubsetInt50 148 150 149

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
SetTests.o 64230 71398 +11.2% 0.90x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
DataAppendDataLargeToLarge 37200 51000 +37.1% 0.73x (?)
Added
Set.isStrictSubset.Empty.Int 576 577 576
Set.isStrictSubset.Int.Empty 367 368 367
SetIsStrictSubsetBox0 934 935 935
SetIsStrictSubsetBox25 858 859 858
SetIsStrictSubsetInt0 622 632 626
SetIsStrictSubsetInt100 1500 1560 1526
SetIsStrictSubsetInt25 248 257 254
SetIsStrictSubsetInt50 466 467 467
Benchmark Check Report
⚠️🔤 SetIsStrictSubsetInt50 name is composed of 5 words.
Split SetIsStrictSubsetInt50 name into dot-separated groups and variants. See http://bit.ly/BenchmarkNaming
⚠️🔤 SetIsStrictSubsetInt25 name is composed of 5 words.
Split SetIsStrictSubsetInt25 name into dot-separated groups and variants. See http://bit.ly/BenchmarkNaming
⚠️🔤 SetIsStrictSubsetBox25 name is composed of 5 words.
Split SetIsStrictSubsetBox25 name into dot-separated groups and variants. See http://bit.ly/BenchmarkNaming
⚠️🔤 SetIsStrictSubsetInt0 name is composed of 5 words.
Split SetIsStrictSubsetInt0 name into dot-separated groups and variants. See http://bit.ly/BenchmarkNaming
⚠️🔤 SetIsStrictSubsetBox0 name is composed of 5 words.
Split SetIsStrictSubsetBox0 name into dot-separated groups and variants. See http://bit.ly/BenchmarkNaming
⚠️🔤 SetIsStrictSubsetInt100 name is composed of 5 words.
Split SetIsStrictSubsetInt100 name into dot-separated groups and variants. See http://bit.ly/BenchmarkNaming
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

@Gumichocopengin8
Copy link
Contributor Author

Gumichocopengin8 commented Apr 11, 2019

As Benchmark Check Report mentions, benchmark names should follow the convention.
I will change the names. Just add . between chunks .
Example: SetIntersectionBox25 -> Set.intersection.Box25

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

We shouldn't rename the existing benchmarks.

@@ -68,32 +68,32 @@ public let SetTests = [
tags: [.validation, .api, .Set],
setUpFunction: { blackHole([setAB, setE]) }),
BenchmarkInfo(
name: "SetIsSubsetInt0",
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately we shouldn't change the names of existing benchmarks here -- we're using these to track performance across compiler releases.

It is a good idea to proper names for the new benchmarks, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your advice.
I fixed it.

@lorentey
Copy link
Member

Looks good, thanks @Gumichocopengin8!

@lorentey
Copy link
Member

@swift-ci benchmark

@lorentey
Copy link
Member

@swift-ci smoke test

@swift-ci
Copy link
Contributor

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
CharacterLiteralsLarge 97 108 +11.3% 0.90x
Improvement
FlattenListLoop 4709 4335 -7.9% 1.09x (?)
Array2D 8112 7520 -7.3% 1.08x
RemoveWhereSwapInts 70 65 -7.1% 1.08x
MapReduce 426 397 -6.8% 1.07x (?)
FlattenListFlatMap 7007 6539 -6.7% 1.07x (?)
MapReduceAnyCollection 426 398 -6.6% 1.07x (?)
Added
Set.isStrictSubset.Box0 381 382 382
Set.isStrictSubset.Box25 165 169 166
Set.isStrictSubset.Empty.Int 172 176 173
Set.isStrictSubset.Int.Empty 95 101 98
Set.isStrictSubset.Int0 261 263 262
Set.isStrictSubset.Int100 600 601 600
Set.isStrictSubset.Int25 77 78 77
Set.isStrictSubset.Int50 153 155 154

Code size: -O

TEST OLD NEW DELTA RATIO
Regression
SetTests.o 72118 80038 +11.0% 0.90x

Performance: -Osize

TEST MIN MAX MEAN MAX_RSS
Added
Set.isStrictSubset.Box0 375 375 375
Set.isStrictSubset.Box25 258 262 259
Set.isStrictSubset.Empty.Int 181 185 182
Set.isStrictSubset.Int.Empty 101 107 103
Set.isStrictSubset.Int0 268 276 272
Set.isStrictSubset.Int100 595 597 596
Set.isStrictSubset.Int25 76 79 77
Set.isStrictSubset.Int50 148 152 149

Code size: -Osize

TEST OLD NEW DELTA RATIO
Regression
SetTests.o 64230 71446 +11.2% 0.90x

Performance: -Onone

TEST MIN MAX MEAN MAX_RSS
Added
Set.isStrictSubset.Box0 865 865 865
Set.isStrictSubset.Box25 861 881 868
Set.isStrictSubset.Empty.Int 585 586 585
Set.isStrictSubset.Int.Empty 380 415 392
Set.isStrictSubset.Int0 628 633 631
Set.isStrictSubset.Int100 1499 1546 1515
Set.isStrictSubset.Int25 248 251 249
Set.isStrictSubset.Int50 472 472 472
Benchmark Check Report
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

@Gumichocopengin8
Copy link
Contributor Author

Gumichocopengin8 commented Apr 16, 2019

Need to run test again??

@lorentey
Copy link
Member

Apparently so...

@swift-ci please smoke test macOS platform

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.

3 participants