Comments (2)
I think the issue you're seeing on the small vectors is that Storable Vectors have better alignment guarantees than unboxed vectors (because storable uses immovable vectors)
https://gist.github.com/cartazio/2eb344be116c3d83cecb
./main
benchmarking dot prod (3)/List
time 296.5 ns (293.8 ns .. 299.7 ns)
0.999 R² (0.998 R² .. 1.000 R²)
mean 298.0 ns (294.9 ns .. 302.6 ns)
std dev 12.54 ns (9.453 ns .. 17.11 ns)
variance introduced by outliers: 61% (severely inflated)
benchmarking dot prod (3)/Vector
time 20.51 ns (20.18 ns .. 20.92 ns)
0.993 R² (0.984 R² .. 0.998 R²)
mean 21.53 ns (20.78 ns .. 22.85 ns)
std dev 3.503 ns (2.124 ns .. 5.587 ns)
variance introduced by outliers: 97% (severely inflated)
benchmarking dot prod (3)/Unboxed
time 15.53 ns (15.24 ns .. 15.88 ns)
0.996 R² (0.993 R² .. 0.998 R²)
mean 16.13 ns (15.69 ns .. 16.96 ns)
std dev 2.028 ns (1.304 ns .. 3.064 ns)
variance introduced by outliers: 95% (severely inflated)
benchmarking dot prod (3)/Storable
time 12.75 ns (12.59 ns .. 12.96 ns)
0.998 R² (0.997 R² .. 0.999 R²)
mean 12.86 ns (12.69 ns .. 13.27 ns)
std dev 819.3 ps (440.3 ps .. 1.552 ns)
variance introduced by outliers: 82% (severely inflated)
benchmarking dot prod (3000)/List
time 212.6 μs (211.0 μs .. 214.7 μs)
0.998 R² (0.997 R² .. 0.999 R²)
mean 218.8 μs (215.1 μs .. 224.8 μs)
std dev 15.36 μs (11.01 μs .. 21.84 μs)
variance introduced by outliers: 65% (severely inflated)
benchmarking dot prod (3000)/Vector
time 7.241 μs (7.076 μs .. 7.409 μs)
0.995 R² (0.991 R² .. 0.998 R²)
mean 7.303 μs (7.163 μs .. 7.474 μs)
std dev 540.9 ns (423.0 ns .. 713.1 ns)
variance introduced by outliers: 78% (severely inflated)
benchmarking dot prod (3000)/Unboxed
time 2.886 μs (2.846 μs .. 2.928 μs)
0.998 R² (0.997 R² .. 0.999 R²)
mean 2.876 μs (2.842 μs .. 2.932 μs)
std dev 143.1 ns (89.39 ns .. 224.8 ns)
variance introduced by outliers: 64% (severely inflated)
benchmarking dot prod (3000)/Storable
time 2.891 μs (2.857 μs .. 2.934 μs)
0.998 R² (0.997 R² .. 0.999 R²)
mean 2.927 μs (2.885 μs .. 2.988 μs)
std dev 160.7 ns (131.5 ns .. 200.4 ns)
variance introduced by outliers: 68% (severely inflated)
from vector.
i guess what i'm saying is storable and unboxed have different memory layouts, so they will behave different under different workloads
from vector.
Related Issues (20)
- High level documentation? HOT 1
- overlaps for Data.Vector.Mutable behaves oddly for empty vectors HOT 2
- Performance issues with `foldl'` and large tuples HOT 3
- Add a variant unfoldrExactN, returning the resulting generator HOT 3
- Vector tests take more than 4GB memory to build HOT 3
- `Data.Vector.Fusion.Bundle.Size.Size` fields are not strict HOT 1
- Why is `Data.Vector.Generic.New.New` not a newtype? HOT 2
- Question: Is there a reason why `Unbox a => Maybe (Unbox a)` doesn't exist? HOT 1
- Is `vector` susceptible to the same fusion problems as `text`? HOT 2
- Improve compilation time HOT 3
- Split generic tests into separate package HOT 5
- Tests fail when built against QuickCheck-2.14.3 HOT 2
- New version vector 0.14? HOT 11
- Support `primitive-0.9` HOT 1
- Semantics and implementation of move for SoA vectors
- API using Applicative (traverse et.al.)
- Add total counterparts to partial functions, such as `head`. HOT 25
- catMaybes HOT 2
- Add strict boxed vectors HOT 12
- Data.Vector.Generic.New.unstream (and others) can't be specialized HOT 1
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 vector.