Skip to content

The OBJECT_CACHE seems to be slower than without it #1856

@charleskawczynski

Description

@charleskawczynski

Now that we've fixed a bunch of inference failures in the configuration of spaces, I'm wondering how useful the OBJECT_CACHE is. From fresh sessions:

Main
julia> using Revise; @time include(joinpath("test", "Spaces", "opt_spaces.jl"))
[ Info: Inference may have improved for SpectralElementSpace1D: (n_found, n_allowed) = (135, 137)
[ Info: Inference may have improved for SpectralElementSpace2D: (n_found, n_allowed) = (284, 287)
[ Info: Inference may have improved for ColumnCenterFiniteDifferenceSpace: (n_found, n_allowed) = (4, 118)
[ Info: Inference may have improved for ColumnFaceFiniteDifferenceSpace: (n_found, n_allowed) = (5, 118)
[ Info: Inference may have improved for SphereSpectralElementSpace: (n_found, n_allowed) = (290, 293)
[ Info: Inference may have improved for CenterExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (295, 321)
[ Info: Inference may have improved for FaceExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (295, 321)
[ Info: Inference may have improved for _SpectralElementGrid2D: (n_found, n_allowed) = (0, 12)
Test Summary:          | Pass  Total   Time
Number of JET failures |    9      9  10.6s
 20.427916 seconds (57.84 M allocations: 4.156 GiB, 9.20% gc time, 35.98% compilation time: 2% of which was recompilation)

julia> using Revise; @time include(joinpath("test", "Spaces", "opt_spaces.jl"))
WARNING: replacing module TestUtilities.
[ Info: Inference may have improved for SpectralElementSpace1D: (n_found, n_allowed) = (135, 137)
[ Info: Inference may have improved for SpectralElementSpace2D: (n_found, n_allowed) = (284, 287)
[ Info: Inference may have improved for ColumnCenterFiniteDifferenceSpace: (n_found, n_allowed) = (4, 118)
[ Info: Inference may have improved for ColumnFaceFiniteDifferenceSpace: (n_found, n_allowed) = (5, 118)
[ Info: Inference may have improved for SphereSpectralElementSpace: (n_found, n_allowed) = (290, 293)
[ Info: Inference may have improved for CenterExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (295, 321)
[ Info: Inference may have improved for FaceExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (295, 321)
[ Info: Inference may have improved for _SpectralElementGrid2D: (n_found, n_allowed) = (0, 12)
Test Summary:          | Pass  Total  Time
Number of JET failures |    9      9  0.7s
  0.754967 seconds (3.54 M allocations: 245.710 MiB, 17.76% gc time, 24.16% compilation time)
Removed get!(Cache.OBJECT_CACHE
julia> using Revise; @time include(joinpath("test", "Spaces", "opt_spaces.jl"))
[ Info: Inference may have improved for SpectralElementSpace1D: (n_found, n_allowed) = (0, 137)
[ Info: Inference may have improved for SpectralElementSpace2D: (n_found, n_allowed) = (99, 287)
[ Info: Inference may have improved for ColumnCenterFiniteDifferenceSpace: (n_found, n_allowed) = (0, 118)
[ Info: Inference may have improved for ColumnFaceFiniteDifferenceSpace: (n_found, n_allowed) = (0, 118)
[ Info: Inference may have improved for SphereSpectralElementSpace: (n_found, n_allowed) = (12, 293)
[ Info: Inference may have improved for CenterExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (12, 321)
[ Info: Inference may have improved for FaceExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (12, 321)
[ Info: Inference may have improved for _SpectralElementGrid2D: (n_found, n_allowed) = (0, 12)
Test Summary:          | Pass  Total   Time
Number of JET failures |    9      9  11.0s
 12.654057 seconds (69.27 M allocations: 4.786 GiB, 13.23% gc time, 44.82% compilation time: 3% of which was recompilation)

julia> using Revise; @time include(joinpath("test", "Spaces", "opt_spaces.jl"))
WARNING: replacing module TestUtilities.
[ Info: Inference may have improved for SpectralElementSpace1D: (n_found, n_allowed) = (0, 137)
[ Info: Inference may have improved for SpectralElementSpace2D: (n_found, n_allowed) = (99, 287)
[ Info: Inference may have improved for ColumnCenterFiniteDifferenceSpace: (n_found, n_allowed) = (0, 118)
[ Info: Inference may have improved for ColumnFaceFiniteDifferenceSpace: (n_found, n_allowed) = (0, 118)
[ Info: Inference may have improved for SphereSpectralElementSpace: (n_found, n_allowed) = (12, 293)
[ Info: Inference may have improved for CenterExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (12, 321)
[ Info: Inference may have improved for FaceExtrudedFiniteDifferenceSpace: (n_found, n_allowed) = (12, 321)
[ Info: Inference may have improved for _SpectralElementGrid2D: (n_found, n_allowed) = (0, 12)
Test Summary:          | Pass  Total  Time
Number of JET failures |    9      9  0.6s
  0.655213 seconds (3.67 M allocations: 257.794 MiB, 29.11% compilation time)

cc @Sbozzolo, @dennisYatunin, @sriharshakandala

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