Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.32 KB

README.md

File metadata and controls

39 lines (28 loc) · 1.32 KB

ThreadingTools

Build Status Build Status Codecov Coveralls

Usage

ThreadingTools defines threaded versions of the following functions: map, map!, mapreduce, reduce, sum, prod, minimum, maximum

julia> using ThreadingTools

julia> using BenchmarkTools

julia> Threads.nthreads()
4

julia> data = randn(10^6);

julia> @btime sum(sin, data)
  13.114 ms (1 allocation: 16 bytes)
279.2390057547361

julia> @btime tsum(sin,data)
  3.722 ms (60 allocations: 4.09 KiB)
279.23900575473743

julia> @btime mapreduce(sin,*,data)
  15.607 ms (1 allocation: 16 bytes)
0.0

julia> @btime tmapreduce(sin,*,data)
  3.718 ms (60 allocations: 4.08 KiB)
0.0

Credits

ThreadingTools was inspired by and reuses some code of KissThreading