Skip to content

scala.testing.Benchmark is deprecated and should no longer be mentioned #752

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

Closed
SethTisue opened this issue Mar 29, 2017 · 15 comments
Closed
Labels

Comments

@SethTisue
Copy link
Member

it appears in

es/overviews/parallel-collections/performance.md
ja/overviews/parallel-collections/performance.md
overviews/parallel-collections/performance.md
zh-cn/overviews/parallel-collections/performance.md
@DarkDimius
Copy link
Contributor

DarkDimius commented Mar 29, 2017

+ ru/overviews/parallel-collections/performance.md

@jiminhsieh
Copy link
Member

@SethTisue Is it just simple remove anything related to scala.testing.Benchmark? It would remove lots of document. Or rewrite that part of document with other way of benchmark. Thanks!

@SethTisue
Copy link
Member Author

I think that whole "Microbenchmarking example" section could be cut way back, with the specifics in the second half simply removed. In its place, you could link to https://github.com/scala/scala/blob/2.12.x/test/benchmarks/README.md as an example of proper benchmarking code.

@jiminhsieh
Copy link
Member

I would try to send the PR, let you see does it works as you expect. By the way, in my opinion, the second half of How big should a collection be to parallel? should be remove or rewrite too.

@SethTisue
Copy link
Member Author

yeah, I agree that could be condensed substantially.

@jiminhsieh
Copy link
Member

Hi @SethTisue I have some ideas about How big should a collection be to go parallel?. I change the code snippet with JMH instead of scala.testing.Benchmark and JDK7 to JDK8. The results of the code snippet would be the results of JMH. Like this:

[info] Benchmark                    Mode  Cnt        Score       Error  Units
[info] TestBenchmark.iterator      thrpt   30      418.637 ±     7.991  ops/s
[info] TestBenchmark.list          thrpt   30      348.523 ±     9.162  ops/s
[info] TestBenchmark.range         thrpt   30      367.331 ±     8.731  ops/s
[info] TestBenchmark.readFromFile  thrpt   30  3466096.653 ± 40711.291  ops/s
[info] TestBenchmark.stream        thrpt   30      112.702 ±     1.214  ops/s

BTW, I have similar CPU which is E3 quad-core processor.

@SethTisue
Copy link
Member Author

yes, that sounds like a good change!

@jiminhsieh
Copy link
Member

@SethTisue I did some benchmarks locally. There is the source code that I did the benchmark.

Environment:

  • CPU: E3-1231 v3 without hyper-threading and turbo boost
  • RAM: 16G, I allocated 8G for each benchmark.
  • OS: Debian 8 with limitation(2.5GHz) of CPU frequency.
  • JVM: Oracle 1.8.0_144-b01
  • Scala: 2.12.3

Result:

[info] MapBench.map           120000       N/A  thrpt   45    91.299 ±   1.214  ops/s
[info] MapBench.map            15000       N/A  thrpt   45   702.102 ±   1.874  ops/s
[info] ParMapBench.map        120000         1  thrpt   45    98.208 ±   0.464  ops/s
[info] ParMapBench.map        120000         2  thrpt   45   188.050 ±   1.217  ops/s
[info] ParMapBench.map        120000         4  thrpt   45   287.804 ±   2.439  ops/s
[info] ParMapBench.map         15000         1  thrpt   45   872.125 ±   2.228  ops/s
[info] ParMapBench.map         15000         2  thrpt   45  1578.931 ±   8.447  ops/s
[info] ParMapBench.map         15000         4  thrpt   45  2556.409 ±  14.718  ops/s
[info] ParVectorBench.reduce  250000         1  thrpt   45   582.542 ±  12.397  ops/s
[info] ParVectorBench.reduce  250000         2  thrpt   45   655.938 ±  12.524  ops/s
[info] ParVectorBench.reduce  250000         4  thrpt   45   927.864 ±   7.750  ops/s
[info] ParVectorBench.reduce  120000         1  thrpt   45   944.875 ± 137.443  ops/s
[info] ParVectorBench.reduce  120000         2  thrpt   45  1481.952 ±  34.182  ops/s
[info] ParVectorBench.reduce  120000         4  thrpt   45  2468.674 ±  42.307  ops/s
[info] VectorBench.reduce     250000       N/A  thrpt   45   495.297 ±   1.650  ops/s
[info] VectorBench.reduce     120000       N/A  thrpt   45  1116.625 ±   2.346  ops/s

Do you have any suggestion with this benchmark? Mybe I could change to different size or add bigger size of collection for the benchamrk? Thanks! :)

@SethTisue
Copy link
Member Author

@jiminhsieh this isn't an area I've worked in myself, so I can't give good detailed feedback. perhaps @Ichoran or @axel22 have thoughts on it. doing a deep dive on parallel collections performance is outside the scope of this ticket, anyway — I don't mean to discourage you from going deeper on it if it interests you, but in the meantime it would be nice to just get a basic "get rid of scala.testing.Benchmark" fix in

@Ichoran
Copy link

Ichoran commented Sep 13, 2017 via email

@axel22
Copy link
Contributor

axel22 commented Sep 13, 2017

@jiminhsieh Parallel collections are not specialized for primitive types, so you should not expect to get too much performance from Vector[Int] or ParVector[Int] - most of what you're measuring in map operations is boxing. To compare, I suggest testing collections that contain objects (e.g. Vector[String]) and do some operation on those objects.

@jiminhsieh
Copy link
Member

@Ichoran @axel22 Thanks for all of your indications! I would try to work on what you mentioned in my own experiments.
@SethTisue Since it will need deeper knowledge to get informative results of benchmark, I would just remove doc related to scala.testing.Benchmark.

@jiminhsieh
Copy link
Member

@jvican This ticket didn't finish yet.
I only finished :

  • _overviews/parallel-collections/performance.md
  • _zh-cn/overviews/parallel-collections/performance.md

But those are not finish:

  • _es/overviews/parallel-collections/performance.md
  • _ja/overviews/parallel-collections/performance.md
  • _ru/overviews/parallel-collections/performance.md

I guess it would be better to reopen. And maybe we could ask for help on twitter to finish the rest?

@SethTisue SethTisue reopened this Dec 8, 2017
@SethTisue
Copy link
Member Author

we don't have an appropriate Twitter account for this (it's too specific for https://twitter.com/scala_lang, I think), but you could certainly ask on Gitter and/or Discourse

@SethTisue
Copy link
Member Author

SethTisue commented Dec 8, 2017

I'm not sure whether it makes sense to leave the issue open or not. The sad fact is that all of the translations often get out of date w/r/t to the English versions, it's a general problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants