• Stars
    star
    190
  • Rank 196,821 (Top 4 %)
  • Language
    Julia
  • License
    MIT License
  • Created about 1 year ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reduce time-to-first-execution of Julia code

PrecompileTools

Stable Build Status Coverage

PrecompileTools allows you to reduce the latency of the first execution of Julia code. It is applicable for package developers and for "ordinary users" in their personal workflows.

To learn how to use PrecompileTools, see the documentation.

PrecompileTools and PackageCompiler

Particularly on Julia 1.9 and higher, PrecompileTools allows dramatic reduction in "time to first execution" (TTFX) without the need for user-customization. In this respect, it shares goals with (and performs similarly to) PackageCompiler.

Nevertheless, the two are not identical:

  • only PrecompileTools can be used by package developers to ensure a better out-of-box experience for your users
  • only PrecompileTools allows you to update your packages without needing to rebuild Julia
  • only PackageCompiler dramatically speeds up loading time (i.e., using ...) for all the packages

Here is a table summarizing the information.

Task Julia 1.9 + PrecompileTools PackageCompiler
Developers can reduce out-of-box TTFX for their users βœ”οΈ ❌
Users can reduce TTFX for custom tasks βœ”οΈ βœ”οΈ
Packages can be updated without rebuilding system image βœ”οΈ ❌
Reduces time to load (TTL) ❌ βœ”οΈ

The difference in time to load arises because the system image can safely skip all the code-validation checks that are necessary when loading packages. Examples of the reduction in time to first execution and time to load can be found in the Julia 1.9 highlights blog post.

Inspecting the package precompile files

PkgCacheInspector provides insight about what's stored in Julia's package precompile files.

History (origins as SnoopPrecompile)

PrecompileTools is the successor to SnoopPrecompile. PrecompileTools differs in naming and in how one disables precompilation, but is otherwise a drop-in replacement.

This new package was created for several reasons:

  • PrecompileTools has become (directly or indirectly) a dependency of much of the Julia ecosystem, a trend that seems likely to grow with time. Therefore, this package is now hosted in the JuliaLang GitHub organization.
  • As Julia's own stdlibs migrate to become independently updateable (true for DelimitedFiles in Julia 1.9, with others anticipated for Julia 1.10), several of them would like to use PrecompileTools for high-quality precompilation. That requires making PrecompileTools its own "upgradable stdlib."
  • This package introduces the use of Preferences to make packages more independent of one another. Since this would have been a breaking change, it seemed like a good opportunity to fix other issues, too.

For more information and discussion, see the Discourse announcement post.

More Repositories

1

julia

The Julia Programming Language
Julia
44,029
star
2

IJulia.jl

Julia kernel for Jupyter
Julia
2,718
star
3

PackageCompiler.jl

Compile your Julia Package
Julia
1,373
star
4

juliaup

Julia installer and version multiplexer
Rust
887
star
5

Pkg.jl

Pkg - Package manager for the Julia programming language
Julia
587
star
6

www.julialang.org

Julia Project website
Julia
342
star
7

JuliaSyntax.jl

The Julia compiler frontend
Julia
263
star
8

METADATA.jl

Metadata for registered Julia packages up to Julia v0.6. No longer maintained. Please see https://github.com/JuliaRegistries/General instead.
Julia
219
star
9

AllocCheck.jl

AllocCheck
Julia
186
star
10

www_old.julialang.org

Julia Project web site (Old)
Jupyter Notebook
149
star
11

Compat.jl

Compatibility across Julia versions
Julia
137
star
12

Example.jl

Example Julia package repo.
Julia
123
star
13

julia-logo-graphics

official versions of the Julia logo
Julia
108
star
14

Tokenize.jl

Tokenization for Julia source code
Julia
99
star
15

Downloads.jl

Julia
90
star
16

JuliaParser.jl

A rewrite of Julia's parser in Julia
Julia
89
star
17

PackageCompilerX.jl

Julia
85
star
18

Microbenchmarks

Microbenchmarks comparing the Julia Programming language with other languages
Jupyter Notebook
83
star
19

PkgDev.jl

Tools for Julia package developers
Julia
70
star
20

Juleps

Julia Enhancement Proposals
67
star
21

FancyDiagnostics.jl

Better parser errors for Julia
Julia
44
star
22

MbedTLS.jl

Wrapper around mbedtls
Julia
41
star
23

TOML.jl

A fast TOML parser for TOML 1.0 written in Julia
Julia
33
star
24

JuliaDoc

Python
28
star
25

docs.julialang.org

Repository for hosting the manual for the Julia language
Julia
25
star
26

SoftGlobalScope.jl

utilities for "soft" global scope in interactive Julia environments
Julia
24
star
27

LinearAlgebra.jl

Julia
21
star
28

Distributed.jl

Create and control multiple Julia processes remotely for distributed computing. Ships as a Julia stdlib.
Julia
18
star
29

BugReporting.jl

Streamlines bug reporting for julia
Julia
17
star
30

devcontainer-features

Julia Development Container Feature
Shell
16
star
31

NetworkOptions.jl

Julia
12
star
32

libosxunwind

Clone of Apple's libunwind, enhanced for the Julia Profiler
C++
11
star
33

BumpStdlibs.jl

Update the hashes and checksums of all Julia stdlibs in just four clicks.
Julia
11
star
34

JuliaSyntaxHighlighting.jl

Julia
9
star
35

StyledStrings.jl

Julia
8
star
36

mintty-julia

5
star
37

Public.jl

Julia
5
star
38

.github

Repository for default community health files
4
star
39

IJuliaCore.jl

Julia
4
star
40

devcontainer-templates

Julia Development Container Template
Shell
4
star
41

pull-request-state-machine

Python
3
star
42

VersionsJSONUtil.jl

Julia
3
star
43

buildkite-rerun-failed

Julia
2
star
44

Test.jl

Julia
1
star