Comments (3)
BTW, I ran mean
by curiosity with benchmark-interface
on TruffleRuby:
$ chruby 2.6.0
$ benchmark-driver bench/mean.yml
Warming up --------------------------------------
inject 45.877k i/s - 49.962k times in 1.089042s (21.80μs/i)
while 39.798k i/s - 43.406k times in 1.090651s (25.13μs/i)
mean 186.456k i/s - 199.606k times in 1.070528s (5.36μs/i)
Calculating -------------------------------------
inject 43.879k i/s - 137.631k times in 3.136621s (22.79μs/i)
while 39.572k i/s - 119.394k times in 3.017167s (25.27μs/i)
mean 191.036k i/s - 559.366k times in 2.928068s (5.23μs/i)
Comparison:
mean: 191035.8 i/s
inject: 43878.7 i/s - 4.35x slower
while: 39571.6 i/s - 4.83x slower
$ chruby truffleruby-1.0.0-rc11
$ benchmark-driver bench/mean.yml
Warming up --------------------------------------
inject 622.604k i/s - 628.830k times in 1.010000s (1.61μs/i)
while 156.294k i/s - 165.984k times in 1.062000s (6.40μs/i)
Calculating -------------------------------------
inject 685.143k i/s - 1.868M times in 2.726163s (1.46μs/i)
while 171.896k i/s - 468.881k times in 2.727697s (5.82μs/i)
Comparison:
inject: 685142.7 i/s
while: 171896.3 i/s - 3.99x slower
So pure Ruby on TruffleRuby is faster than the C extension on MRI :D
As the README says though, inject
and while
are not precision-compensated algorithms.
from enumerable-statistics.
@eregon Thank you for the report. I forgot the bench
rake task.
I think it is very interesting that comparing precision-compensated algorithms between pure-Ruby on TruffleRuby and C version.
from enumerable-statistics.
Fixed at c8fe00b
from enumerable-statistics.
Related Issues (15)
- RubyDataScience HOT 2
- Support bins: option in value_counts
- Support JRuby
- Histogram may contain nil in weights HOT 1
- Where can I get more information about the edge detection algorithm? HOT 1
- Support Ruby 2.2 HOT 1
- Support MemoryView-exportable 1-D array objects
- value_counts
- histogram should accept :auto in nbins argument
- tests fail on i386 (32-bit x86) HOT 11
- Add cumsum and cumprod
- histogram
- Add Windows CI
- Add pivot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enumerable-statistics.