I’m working on a PR to Julia, already could add OrderedDict to Base, independent of Dict, or by replacing it. When replacing, it however makes some stuff slower. [EDIT: short answer, dicts are not thread-safe, see solution on package to make them, and ordered dict is not coming to Base, even though I made a PR for it.]
No dictionary will be fastest for everything, but I noticed in: GitHub - JuliaCollections/OrderedCollections.jl: Julia implementation of associative containers that preserve insertion order
also implements
LittleDict
which is a ordered dictionary, that is much faster than any otherAbstractDict
(ordered or not) for small collections.
[OrderedRobinDict is another option.]
so I’m now testing replacing Dict with it.
$ make
[..]
error during bootstrap:
LoadError("sysimg.jl", 19, LoadError("/home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/Pkg/src/Pkg.jl", 3, LoadError("/home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl", 3, LoadError("/home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/options.jl", 56, MethodError(convert, (Union{Dict, Vector{var"#s852"} where var"#s852"<:Dict}, UDict{Any, Any}[]), 0x0000000000006499)))))
jl_method_error_bare at /home/pharaldsson_sym/myjulia/julia/src/gf.c:1767
jl_method_error at /home/pharaldsson_sym/myjulia/julia/src/gf.c:1785
jl_lookup_generic_ at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2355 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2370
Options at /home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/options.jl:4
#Options#1 at /home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/options.jl:45
Options at /home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/options.jl:45
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
jl_apply at /home/pharaldsson_sym/myjulia/julia/src/julia.h:1687 [inlined]
do_call at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:115
eval_value at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:204
eval_stmt_value at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:155 [inlined]
eval_body at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:575
jl_interpret_toplevel_thunk at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:669
top-level scope at /home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/options.jl:56
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:837
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:785
jl_toplevel_eval_in at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:880
eval at ./boot.jl:360 [inlined]
include_string at ./loading.jl:1026
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
_include at ./loading.jl:1080
include at ./Base.jl:402
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
jl_apply at /home/pharaldsson_sym/myjulia/julia/src/julia.h:1687 [inlined]
do_apply at /home/pharaldsson_sym/myjulia/julia/src/builtins.c:672
jl_f__apply_latest at /home/pharaldsson_sym/myjulia/julia/src/builtins.c:722
include at /home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:14
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
jl_apply at /home/pharaldsson_sym/myjulia/julia/src/julia.h:1687 [inlined]
do_call at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:115
eval_value at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:204
eval_stmt_value at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:155 [inlined]
eval_body at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:575
jl_interpret_toplevel_thunk at /home/pharaldsson_sym/myjulia/julia/src/interpreter.c:669
top-level scope at /home/pharaldsson_sym/myjulia/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:42
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:837
jl_eval_module_expr at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:197 [inlined]
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:661
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:785
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:785
jl_toplevel_eval_in at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:880
eval at ./boot.jl:360 [inlined]
include_string at ./loading.jl:1026
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
_include at ./loading.jl:1080
include at ./Base.jl:402 [inlined]
_require at ./loading.jl:982
require at ./loading.jl:846
require at ./loading.jl:833
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
jl_apply at /home/pharaldsson_sym/myjulia/julia/src/julia.h:1687 [inlined]
call_require at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:423 [inlined]
eval_import_path at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:460
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:717
jl_eval_module_expr at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:197 [inlined]
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:661
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:785
jl_toplevel_eval_in at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:880
eval at ./boot.jl:360 [inlined]
include_string at ./loading.jl:1026
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
_include at ./loading.jl:1080
include at ./Base.jl:402 [inlined]
_require at ./loading.jl:982
require at ./loading.jl:846
require at ./loading.jl:833
_jl_invoke at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2192 [inlined]
jl_apply_generic at /home/pharaldsson_sym/myjulia/julia/src/gf.c:2374
macro expansion at ./timing.jl:233 [inlined]
macro expansion at ./sysimg.jl:73 [inlined]
macro expansion at ./timing.jl:233 [inlined]
top-level scope at ./sysimg.jl:72
jl_toplevel_eval_flex at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:831
jl_parse_eval_all at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:954
jl_load_ at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:1001
jl_load at /home/pharaldsson_sym/myjulia/julia/src/toplevel.c:1014
exec_program at /home/pharaldsson_sym/myjulia/julia/src/jlapi.c:492
true_main at /home/pharaldsson_sym/myjulia/julia/src/jlapi.c:565
repl_entrypoint at /home/pharaldsson_sym/myjulia/julia/src/jlapi.c:672
main at /home/pharaldsson_sym/myjulia/julia/cli/loader_exe.c:46
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /home/pharaldsson_sym/myjulia/julia/usr/bin/julia (unknown line)