• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / #37822
77%

Build:
DEFAULT BRANCH: master
Ran 28 Jun 2024 11:26AM UTC
Jobs 1
Files 360
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Jun 2024 01:08AM UTC coverage: 86.381% (-1.1%) from 87.488%
#37822

push

local

web-flow
inference: implement an opt-in interface to cache generated sources (#54916)

In Cassette-like systems, where inference has to infer many calls of
`@generated` function and the generated function involves complex code
transformations, the overhead from code generation itself can become
significant. This is because the results of code generation are not
cached, leading to duplicated code generation in the following contexts:
- `method_for_inference_heuristics` for regular inference on cached
`@generated` function calls (since
`method_for_inference_limit_heuristics` isn't stored in cached optimized
sources, but is attached to generated unoptimized sources).
- `retrieval_code_info` for constant propagation on cached `@generated`
function calls.

Having said that, caching unoptimized sources generated by `@generated`
functions is not a good tradeoff in general cases, considering the
memory space consumed (and the image bloat). The code generation for
generators like `GeneratedFunctionStub` produced by the front end is
generally very simple, and the first duplicated code generation
mentioned above does not occur for `GeneratedFunctionStub`.

So this unoptimized source caching should be enabled in an opt-in
manner.

Based on this idea, this commit defines the trait `abstract type
Core.CachedGenerator` as an interface for the external systems to
opt-in. If the generator is a subtype of this trait, inference caches
the generated unoptimized code, sacrificing memory space to improve the
performance of subsequent inferences. Specifically, the mechanism for
caching the unoptimized source uses the infrastructure already
implemented in JuliaLang/julia#54362. Thanks to JuliaLang/julia#54362,
the cache for generated functions is now partitioned by world age, so
even if the unoptimized source is cached, the existing invalidation
system will invalidate it as expected.

In JuliaDebug/CassetteOverlay.jl#56, the following benchmark result... (continued)

7 of 8 new or added lines in 1 file covered. (87.5%)

1385 existing lines in 56 files now uncovered.

76243 of 88264 relevant lines covered (86.38%)

15480525.49 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
94.56
-0.27% base/compiler/utilities.jl

Uncovered Existing Lines

Lines Coverage ∆ File
1
68.64
-0.59% base/Base.jl
1
87.23
-1.19% base/error.jl
1
90.8
-0.12% base/multidimensional.jl
1
98.55
-1.45% base/uuid.jl
1
79.71
-0.21% stdlib/FileWatching/src/FileWatching.jl
1
25.17
-0.66% base/strings/cstring.jl
1
93.95
0.0% stdlib/LinearAlgebra/src/diagonal.jl
1
73.24
-1.41% base/libuv.jl
1
89.52
-0.05% base/compiler/tfuncs.jl
1
66.34
-0.99% base/deprecated.jl
1
72.22
-2.78% stdlib/p7zip_jll/src/p7zip_jll.jl
2
93.94
-0.4% base/math.jl
2
88.73
-1.27% stdlib/LibGit2/src/gitcredential.jl
2
86.51
-0.93% base/indices.jl
2
76.15
-1.83% base/experimental.jl
2
92.22
-0.11% stdlib/LinearAlgebra/src/triangular.jl
2
93.8
-0.17% base/bitarray.jl
2
72.9
-2.33% base/c.jl
2
86.24
-0.26% base/boot.jl
2
71.27
-0.85% stdlib/Artifacts/src/Artifacts.jl
3
97.84
-1.3% base/bitset.jl
3
85.07
-1.17% base/strings/annotated.jl
3
94.87
-0.1% stdlib/Test/src/Test.jl
4
75.08
-1.23% base/client.jl
5
90.82
0.0% stdlib/REPL/src/docview.jl
6
94.39
-5.61% base/secretbuffer.jl
8
95.85
-4.15% stdlib/Dates/src/parse.jl
8
59.26
-29.63% base/ryu/Ryu.jl
9
71.83
-6.34% base/terminfo.jl
10
41.18
-58.82% stdlib/TOML/src/TOML.jl
10
75.17
-6.71% base/ryu/fixed.jl
11
92.06
-5.82% base/ryu/exp.jl
12
76.11
-0.56% base/loading.jl
13
88.18
-0.66% base/show.jl
13
64.1
-33.81% base/some.jl
15
80.25
-4.7% stdlib/LibGit2/src/LibGit2.jl
18
96.72
0.0% stdlib/LinearAlgebra/src/generic.jl
20
74.47
-14.02% base/stacktraces.jl
20
81.35
-7.81% stdlib/LibGit2/src/types.jl
23
85.5
-7.06% base/expr.jl
26
75.89
-23.19% stdlib/LibGit2/src/remote.jl
28
73.89
-8.31% base/ryu/shortest.jl
29
60.99
-5.95% base/task.jl
30
70.37
-22.17% stdlib/TOML/src/print.jl
34
87.81
0.94% base/strings/search.jl
35
10.26
-89.74% stdlib/UUIDs/src/UUIDs.jl
37
90.79
0.0% stdlib/LinearAlgebra/src/matmul.jl
39
45.81
-25.89% base/meta.jl
45
23.98
-18.29% stdlib/LibGit2/src/callbacks.jl
71
87.99
-0.1% stdlib/REPL/src/REPLCompletions.jl
71
54.6
-43.55% base/strings/unicode.jl
90
1.08
-96.75% stdlib/Unicode/src/Unicode.jl
103
87.39
-0.04% base/reflection.jl
128
91.56
0.01% stdlib/LinearAlgebra/src/lapack.jl
177
57.47
-31.42% base/toml_parser.jl
199
61.84
-30.05% base/errorshow.jl
Jobs
ID Job ID Ran Files Coverage
1 #37822.1 28 Jun 2024 11:26AM UTC 360
86.38
Source Files on build #37822
  • Tree
  • List 360
  • Changed 291
  • Source Changed 0
  • Coverage Changed 60
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b5d0b905 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc