Skip to content

Instantly share code, notes, and snippets.

@xiaodaigh

xiaodaigh/code Secret

Created October 23, 2017 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaodaigh/6696a94f1b2a4ffd8ade8960f5fd3ac6 to your computer and use it in GitHub Desktop.
Save xiaodaigh/6696a94f1b2a4ffd8ade8960f5fd3ac6 to your computer and use it in GitHub Desktop.
Compare SAC.jl vs FastGroupBy.jl
using FastGroupBy #https://github.com/xiaodaigh/FastGroupBy.jl
using DataBench #https://github.com/xiaodaigh/DataBench.jl
using SAC #https://github.com/andyferris/SAC.jl
# create a synthetic dataset
@dt = createIndexedTable(10_000_000, 100);
# timings
@time res = groupreduce(x->x[1], x->(x[2],1), (x,y)->(x[1]+y[1], x[2]+y[2]), zip(column(dt,:id4), column(dt,:v1)));
@time res = groupreduce(x->x[1], x->(x[2],1), (x,y)->(x[1]+y[1], x[2]+y[2]), zip(column(dt,:id4), column(dt,:v1)));
@time res = meanby(dt, :id4, :v1)
@time res = meanby(dt, :id4, :v1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment