Skip to content

Commit cdfb47a

Browse files
committed
Update benchmarks and remove operators from utils
1 parent 4ac4e48 commit cdfb47a

6 files changed

Lines changed: 7 additions & 23 deletions

File tree

benchmark/coroutines_MM1.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using ResumableFunctions, SimJulia, Distributions, BenchmarkTools
44
while true
55
dt = rand(Exponential(1 / lambd))
66
@yield Timeout(sim, dt)
7-
@coroutine customer2(sim, server, mu)
7+
@coroutine customer(sim, server, mu)
88
end
99
end
1010

@@ -15,14 +15,6 @@ end
1515
@yield Release(server)
1616
end
1717

18-
@resumable function customer2(sim::Simulation, server::Resource, mu::Float64)
19-
@request server req begin
20-
@yield req
21-
dt = rand(Exponential(1 / mu))
22-
@yield Timeout(sim, dt)
23-
end
24-
end
25-
2618
function test_mm1(n::Float64)
2719
sim = Simulation()
2820
server = Resource(sim, 1)
@@ -31,5 +23,4 @@ function test_mm1(n::Float64)
3123
end
3224

3325
test_mm1(100.0)
34-
BenchmarkTools.DEFAULT_PARAMETERS.samples = 100
35-
println(mean(@benchmark test_mm1(100.0)))
26+
@btime test_mm1(100.0)

benchmark/coroutines_fibonnaci.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,4 @@ function run_test()
1616
end
1717

1818
run_test()
19-
BenchmarkTools.DEFAULT_PARAMETERS.samples = 100
20-
println(mean(@benchmark run_test()))
21-
#@profile for i in 1:100; run_test(); end
22-
#Profile.print(format=:flat)
19+
@btime run_test()

benchmark/processes_MM1.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function exp_source(sim::Simulation, lambd::Float64, server::Resource, mu::Float
44
while true
55
dt = rand(Exponential(1/lambd))
66
yield(Timeout(sim, dt))
7-
@process customer2(sim, server, mu)
7+
@process customer(sim, server, mu)
88
end
99
end
1010

@@ -31,5 +31,4 @@ function test_mm1(n::Float64)
3131
end
3232

3333
test_mm1(100.0)
34-
BenchmarkTools.DEFAULT_PARAMETERS.samples = 100
35-
println(mean(@benchmark test_mm1(100.0)))
34+
@btime test_mm1(100.0)

benchmark/processes_fibonnaci.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,4 @@ function run_test()
1616
end
1717

1818
run_test()
19-
BenchmarkTools.DEFAULT_PARAMETERS.samples = 100
20-
println(mean(@benchmark run_test()))
21-
#@profile for i in 1:100; run_test(); end
22-
#Profile.print(format=:flat)
19+
@btime run_test()

src/SimJulia.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module SimJulia
2929

3030
include("base.jl")
3131
include("events.jl")
32-
include("utils/operators.jl")
32+
include("operators.jl")
3333
include("simulations.jl")
3434
include("utils/time.jl")
3535
include("tasks/base.jl")
File renamed without changes.

0 commit comments

Comments
 (0)