Skip to content

Loading unrelated packages makes functions take >30x as long on first run #34681

@oxinabox

Description

@oxinabox

See invenia/JLSO.jl#42 by @colinxs

With JLSO@v1.3.0 and StaticArrays@v0.12.1 I'm seeing the following:

julia> using JLSO
julia> open("/tmp/foo.jlso", "w") do io
            write(io, JLSOFile(:data => rand(1000)))
          end
julia> @time JLSO.load("/tmp/foo.jlso")
  5.034648 seconds (16.27 M allocations: 781.737 MiB, 7.60% gc time)

vs

julia> using StaticArrays, JLSO
julia> open("/tmp/foo.jlso", "w") do io
            write(io, JLSOFile(:data => rand(1000)))
          end
julia> @time JLSO.load("/tmp/foo.jlso")
  172.650491 seconds (259.65 M allocations: 16.296 GiB, 4.05% gc time)

Second call to JLSO.load is still fast, however. Here's my versioninfo() but I'm seeing this across multiple machines.

Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)

Let me know if this issue should be moved to StaticArrays and I'll move it over.

I have verified this and see the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions