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

[breaking] move JSONSchema to a test dependency #1333

Merged
merged 3 commits into from
May 12, 2021
Merged

Conversation

odow
Copy link
Member

@odow odow commented May 11, 2021

A big cause of method invalidation in JuMP is HTTP (jump-dev/JuMP.jl#2273). One option is to fix them in HTTP, but that requires modifications to Base Julia (JuliaWeb/HTTP.jl#712).

The better question is: why do we even have HTTP as a dependency? Turns out it is a transitive dependency of JSONSchema, which may need to access schemas from the web. We only use JSONSchema to validate MOF files, and then not even by default.

And if we move JSONSchema to a test and doc dependency, we save 0.4 seconds on using, and 1000 method invalidations!

Before

julia> @time @eval using MathOptInterface
  2.258680 seconds (3.82 M allocations: 274.937 MiB, 7.42% gc time, 0.15% compilation time)

julia> exit()
(base) oscar@Oscars-MBP MathOptInterface % ~/julia --project=. --banner=no
julia> using SnoopCompileCore

julia> invalidations = @snoopr using MathOptInterface
1339-element Vector{Any}:
  MethodInstance for show(::IOBuffer, ::Any)
  "invalidate_mt_cache"

After

julia> @time @eval using MathOptInterface
  1.858869 seconds (2.80 M allocations: 213.619 MiB, 8.45% gc time, 0.20% compilation time)

julia> exit()
(base) oscar@Oscars-MBP MathOptInterface % ~/julia --project=. --banner=no
julia> using SnoopCompileCore

julia> invalidations = @snoopr using MathOptInterface
374-element Vector{Any}:
  MethodInstance for show(::IOBuffer, ::Any)
  "invalidate_mt_cache"

@odow odow added breaking Submodule: FileFormats About the FileFormats submodule labels May 11, 2021
@odow odow added this to the v0.10 milestone May 11, 2021
@odow odow changed the title Move JSONSchema to a test dependency [breaking] move JSONSchema to a test dependency May 11, 2021
@odow
Copy link
Member Author

odow commented May 11, 2021

Any objections to merging?

@odow odow merged commit 4926eda into master May 12, 2021
@odow odow deleted the od/rm_jsonschema branch May 12, 2021 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Submodule: FileFormats About the FileFormats submodule
Development

Successfully merging this pull request may close these issues.

2 participants