Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benches/multithreaded/bigint/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[deps]
44 changes: 44 additions & 0 deletions benches/multithreaded/bigint/pollardt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
include(joinpath("..", "..", "..", "utils.jl"))

function pollardfactor(n::T=big(1208925819691594988651321)) where T<:Integer
for c in T(1):(n - 3)
G, r, q = ones(T,3)
y = 2
m::T = 1900
ys::T = 0
x::T = 0
while G == 1
x = y
for i in 1:r
y = (y^2 + c) % n
end
k = T(0)
G = T(1)
while k < r && G == 1
for i in 1:min(r - k, m)
ys = y
y = (y^2 + c) % n
q = (q * abs(x - y)) % n
end
G = gcd(q, n)
k += m
end
r *= 2
end
G == n && (G = T(1))
while G == 1
ys = (ys^2 + c) % n
G = gcd(abs(x - ys), n)
end
if G != n
return G
end
end
end

function threadfun()
Threads.@threads for i in 1:8
pollardfactor()
end
end
@gctime threadfun()
1 change: 1 addition & 0 deletions benches/multithreaded/small_arrays/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[deps]
14 changes: 14 additions & 0 deletions benches/multithreaded/small_arrays/alloc_alot.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include(joinpath("..", "..", "..", "utils.jl"))

const N = 2500
a = Vector{Vector{Float64}}(undef,N)

function alloc_alot()
for j in 1:1000
Threads.@threads for i in 1:N
a[i] = rand(2500)
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting.

end

@gctime alloc_alot()