Last active
October 29, 2021 00:41
-
-
Save terasakisatoshi/0fe5777996598dd654df81ec9770c0e3 to your computer and use it in GitHub Desktop.
For those who want to improve first call latency via PackageCompiler.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PackageCompiler | |
PackageCompiler.create_sysimage( | |
[:Atom,:Juno,:Plots], # you may add OhMyREPL, Revise and so on | |
precompile_statements_file=["traced.jl"], | |
precompile_execution_file=["execution.jl"], | |
sysimage_path="atom.dylib", | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# write something you want to improve first call latency | |
using Plots | |
p1=plot(sin) | |
p1|>display | |
p2=plot!(p1, cos) | |
p=plot(rand(10), rand(10)) | |
p|>display |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use
Build system image
execution.jl
andbuild.jl
atom.dylib
(Seebuild.jl
which includessysimage_path="atom.dylib"
). Please modify extensiondylib
as you wish (I'm using macOS).Open Atom
Go to Settings of Julia client
Open preference of Atom (
Cmd + ,
orCtrl +,
). Then, go toPackages
->Settings
( of julia-client) -> ClickJulia Options
. You'll find
Additional Julia Startup Arguments
.Set value
-J/path/to/atom.dylib
toAdditional Julia Startup Arguments
. See the following image.Result
Before
After
You'll find it will improve loading time of Plots.jl Enjoy.