Github user viirya commented on the pull request:
https://github.com/apache/spark/pull/11578#issuecomment-194664538
When `withReplacement = true`.
Without generated code for sample():
Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
range/sample/sum: Best/Avg Time(ms) Rate(M/s)
Per Row(ns) Relative
-------------------------------------------------------------------------------------------
range/sample/sum codegen=false 55656 / 56490 9.4
106.2 1.0X
range/sample/sum codegen=true 35423 / 35758 14.8
67.6 1.6X
With generated code for sample():
Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
range/sample/sum: Best/Avg Time(ms) Rate(M/s)
Per Row(ns) Relative
-------------------------------------------------------------------------------------------
range/sample/sum codegen=false 53058 / 54023 9.9
101.2 1.0X
range/sample/sum codegen=true 33153 / 33509 15.8
63.2 1.6X
So when `withReplacement = true`, the difference is insignificant.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]