Skip to content

jw3126/ThreadingTools.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages