Skip to content

Commit be291cc

Browse files
authored
Update README.md
1 parent fe53c05 commit be291cc

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,22 @@
88

99
Remove jit overhead from your package and compile it into a system image.
1010

11-
Usage Example in [Makie](https://github.com/SimonDanisch/Makie.jl/blob/master/deps/build.jl)
11+
## Usage Example
12+
E.g. do:
13+
```Julia
14+
using PackageCompiler
15+
16+
# This command will use the runtest.jl of Matcha + UnicodeFun to find out what functions to precompile!
17+
# force = false to not force overwriting julia's current system image
18+
PackageCompiler.compile_package("Matcha", "UnicodeFun", force = false, reuse = false)
19+
20+
# build again, with resuing the snoop file
21+
PackageCompiler.compile_package("Matcha", "UnicodeFun", force = false, reuse = true)
22+
23+
# You can define a file that will get run for snooping explicitely like this:
24+
# this makes sure, that binary gets cached for all functions called in `for_snooping.jl`
25+
PackageCompiler.compie_package(("Matcha", "relative/path/for_snooping.jl"))
26+
27+
# if you used force and want your old system image back (force will overwrite the default system image Julia uses) you can run:
28+
PackageCompiler.revert()
29+
```

0 commit comments

Comments
 (0)