Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed drops the more it's used? #6

Open
christopher-dG opened this issue Oct 7, 2019 · 1 comment
Open

Speed drops the more it's used? #6

christopher-dG opened this issue Oct 7, 2019 · 1 comment
Labels
Function: mock Problems with the mock function. performance MOAAAAAR SPEEEEEEED

Comments

@christopher-dG
Copy link
Member

christopher-dG commented Oct 7, 2019

πŸ€·β€β™‚οΈ πŸ€·β€β™‚οΈ πŸ€·β€β™‚οΈ πŸ€·β€β™‚οΈ πŸ€·β€β™‚οΈ

julia> using SimpleMock

julia> using BenchmarkTools

julia> f() = true
f (generic function with 1 method)

julia> g() = true
g (generic function with 1 method)

julia> mock(x -> f(), g)
true

julia> @btime mock(x -> f(), g)
  54.929 ΞΌs (253 allocations: 15.52 KiB)
true

julia> @btime mock(x -> f(), g)

signal (11): Segmentation fault
in expression starting at REPL[6]:1
gc_try_setmark at /buildworker/worker/package_linux64/build/src/gc.c:1582 [inlined]
gc_mark_scan_obj8 at /buildworker/worker/package_linux64/build/src/gc.c:1732 [inlined]
gc_mark_loop at /buildworker/worker/package_linux64/build/src/gc.c:1999
_jl_gc_collect at /buildworker/worker/package_linux64/build/src/gc.c:2729
jl_gc_collect at /buildworker/worker/package_linux64/build/src/gc.c:2912
jl_gc_pool_alloc at /buildworker/worker/package_linux64/build/src/gc.c:1111
jl_gc_alloc_ at /buildworker/worker/package_linux64/build/src/julia_internal.h:274 [inlined]
jl_gc_alloc at /buildworker/worker/package_linux64/build/src/gc.c:2949
jl_alloc_svec_uninit at /buildworker/worker/package_linux64/build/src/simplevector.c:60
jl_alloc_svec at /buildworker/worker/package_linux64/build/src/simplevector.c:69
save_env at /buildworker/worker/package_linux64/build/src/subtype.c:148
forall_exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1354
forall_exists_equal at /buildworker/worker/package_linux64/build/src/subtype.c:1299
forall_exists_equal at /buildworker/worker/package_linux64/build/src/subtype.c:1285 [inlined]
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1270
subtype_unionall_callback at /buildworker/worker/package_linux64/build/src/subtype.c:786 [inlined]
with_tvar at /buildworker/worker/package_linux64/build/src/subtype.c:664 [inlined]
subtype_unionall at /buildworker/worker/package_linux64/build/src/subtype.c:798
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1218
subtype_unionall_callback at /buildworker/worker/package_linux64/build/src/subtype.c:786 [inlined]
with_tvar at /buildworker/worker/package_linux64/build/src/subtype.c:664 [inlined]
subtype_unionall at /buildworker/worker/package_linux64/build/src/subtype.c:798
subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1218
exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1332 [inlined]
forall_exists_subtype at /buildworker/worker/package_linux64/build/src/subtype.c:1360
jl_subtype_env at /buildworker/worker/package_linux64/build/src/subtype.c:1630
jl_isa at /buildworker/worker/package_linux64/build/src/subtype.c:1776
jl_new_structv at /buildworker/worker/package_linux64/build/src/datatype.c:837
Type at /home/degraafc/code/SimpleMock/src/metadata.jl:14
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
#mock#18 at /home/degraafc/code/SimpleMock/src/mock_fun.jl:102
mock at /home/degraafc/code/SimpleMock/src/mock_fun.jl:86 [inlined]
##core#93417 at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:297
##sample#93418 at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:305
sample at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:320 [inlined]
#_lineartrial#41 at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:71
_lineartrial at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:63
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1614 [inlined]
jl_f__apply at /buildworker/worker/package_linux64/build/src/builtins.c:563
jl_f__apply_latest at /buildworker/worker/package_linux64/build/src/builtins.c:601
#invokelatest#1 at ./essentials.jl:790 [inlined]
invokelatest at ./essentials.jl:789 [inlined]
#lineartrial#38 at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:33 [inlined]
lineartrial at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:33 [inlined]
#tune!#44 at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:135
tune! at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:134 [inlined]
tune! at /home/degraafc/.local/share/julia/packages/BenchmarkTools/7aqwe/src/execution.jl:134
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:323
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:411
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:362 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:772
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:884
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f7f87b07a8f)
unknown function (ip: 0x8)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:893
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:815
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:764
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:844
eval at ./boot.jl:330
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
#26 at ./task.jl:268
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1614 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:596
unknown function (ip: 0xffffffffffffffff)
Allocations: 48891945 (Pool: 48890252; Big: 1693); GC: 138
zsh: segmentation fault (core dumped)  julia --project -q

Happens on 1.2 and 1.3.0-rc3, but not on 1.0.5, curiously.

@christopher-dG christopher-dG changed the title Inconsistent segfault when benchmarking Speed drops the more it's used? Jan 10, 2020
@christopher-dG
Copy link
Member Author

No more segfaults, but weird performance issues...

julia> @btime mock(x -> f(), g)
  104.807 ms (108125 allocations: 6.43 MiB)
true

julia> @btime mock(x -> f(), g)
  163.629 ms (138339 allocations: 8.76 MiB)
true

julia> @btime mock(x -> f(), g)
  244.709 ms (159986 allocations: 10.43 MiB)
true

julia> @btime mock(x -> f(), g)
  310.267 ms (176010 allocations: 11.63 MiB)
true

julia> @btime mock(x -> f(), g)
  359.486 ms (188319 allocations: 12.57 MiB)
true

@christopher-dG christopher-dG added Function: mock Problems with the mock function. performance MOAAAAAR SPEEEEEEED labels Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Function: mock Problems with the mock function. performance MOAAAAAR SPEEEEEEED
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant