Revision 5d03fcd948ad862458f2b7b09cc97ad66c08ac1f authored by Shuhei Kadowaki on 29 August 2022, 12:04:18 UTC, committed by Kristoffer on 29 August 2022, 20:32:31 UTC
`CachedMethodTable` was removed within #44240 as we couldn't confirm any performance improvement then. However it turns out the optimization was critical in some real world cases (e.g. #46492), so this commit revives the mechanism with the following tweaks that should make it more effective: - create method table cache per inference (rather than per local inference on a function call as on the previous implementation) - only use cache mechanism for abstract types (since we already cache lookup result at the next level as for concrete types) As a result, the following snippet reported at #46492 recovers the compilation performance: ```julia using ControlSystems a_2 = [-5 -3; 2 -9] C_212 = ss(a_2, [1; 2], [1 0; 0 1], [0; 0]) @time norm(C_212) ``` > on master ``` julia> @time norm(C_212) 364.489044 seconds (724.44 M allocations: 92.524 GiB, 6.01% gc time, 100.00% compilation time) 0.5345224838248489 ``` > on this commit ``` julia> @time norm(C_212) 26.539016 seconds (62.09 M allocations: 5.537 GiB, 5.55% gc time, 100.00% compilation time) 0.5345224838248489 ``` (cherry picked from commit 844574411fc77f5de1528a2ab30b9457238959cf)
1 parent c65611a
File | Mode | Size |
---|---|---|
Artifacts | ||
Base64 | ||
CRC32c | ||
CompilerSupportLibraries_jll | ||
Dates | ||
DelimitedFiles | ||
Distributed | ||
FileWatching | ||
Future | ||
GMP_jll | ||
InteractiveUtils | ||
LLVMLibUnwind_jll | ||
LazyArtifacts | ||
LibCURL_jll | ||
LibGit2 | ||
LibGit2_jll | ||
LibSSH2_jll | ||
LibUV_jll | ||
LibUnwind_jll | ||
Libdl | ||
LinearAlgebra | ||
Logging | ||
MPFR_jll | ||
Markdown | ||
MbedTLS_jll | ||
Mmap | ||
MozillaCACerts_jll | ||
OpenBLAS_jll | ||
OpenLibm_jll | ||
PCRE2_jll | ||
Printf | ||
Profile | ||
REPL | ||
Random | ||
Serialization | ||
SharedArrays | ||
Sockets | ||
SuiteSparse_jll | ||
TOML | ||
Test | ||
UUIDs | ||
Unicode | ||
Zlib_jll | ||
dSFMT_jll | ||
libLLVM_jll | ||
libblastrampoline_jll | ||
nghttp2_jll | ||
p7zip_jll | ||
.gitignore | -rw-r--r-- | 275 bytes |
ArgTools.version | -rw-r--r-- | 224 bytes |
Downloads.version | -rw-r--r-- | 234 bytes |
LibCURL.version | -rw-r--r-- | 220 bytes |
Makefile | -rw-r--r-- | 3.0 KB |
NetworkOptions.version | -rw-r--r-- | 264 bytes |
Pkg.version | -rw-r--r-- | 203 bytes |
SHA.version | -rw-r--r-- | 202 bytes |
SparseArrays.version | -rw-r--r-- | 254 bytes |
Statistics.version | -rw-r--r-- | 240 bytes |
SuiteSparse.version | -rw-r--r-- | 250 bytes |
Tar.version | -rw-r--r-- | 194 bytes |
Computing file changes ...