Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upScale use case: data structure benchmark #45
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
moved to elm-explorations/benchmark#9 |
BrianHicks
closed this
May 11, 2018
Repository owner
locked as off topic and limited conversation to collaborators
May 11, 2018
Repository owner
unlocked this conversation
May 11, 2018
Repository owner
locked and limited conversation to collaborators
May 11, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
mpizenberg commentedJan 6, 2018
Hi and first of all, thanks for this package!
Context
As suggested in
scaledocumentation and in this discourse post here is my use case forscale. I'm currently working on making JavaScript TypedArray API available in elm. My reasons are two-fold:ArrayBuffers,Blobs,Files, network exchange,canvasdata etc. So having them in elm is important in my opinion.The code is on github: mpizenberg/elm-js-typed-array.
To make this happen, I'm benchmarking all key functions of the package (
initialize,map,foldl,append, ...). Benchmarks are in thebenchmarks/directory.Benchmark Structure
The goal of the benchmarks are to make sure that typed arrays are fast for all potential use cases, ranging from small array manipulation, to big image-like (~10^6 pixels) matrices. Therefore, I'm comparing each key function at different scales (set in
Constants.sizeScales) with three data structures,List,ArrayandJsTypedArray(4 actually since testing bothJsTypedArray Uint8andJsTypedArray Float64).Therefore, every benchmark file looks like the following:
Results / Wished Features
At the end of the day, what I'd like to visualize is a plot comparing the different data structures at different scales. With the hypothesis that the benchmark went well and I can rely on the timing measures, I'd do a plot similar to the one below. Using logarithmic scale to make it more understandable. Plot source on this google document. With this plot, you immediately see for example that at large scale, the appending operation with
JsTypedArray Uint8is one order of magnitude faster than with other data structures.