Comments (2)
Well, you're hitting the infamous time-to-first-plot issue with Julia. Since Julia is a just-in-time compiled language, a lot of code needs to be compiled for the first run of a function. Subsequent runs will be much faster. In short, that's why most people prefer an interactive REPL base workflow (similar to a Jupyter-Notebook), where you keep your Julia session alive while changing code, updating scripts and recreate plots rather than executing full scripts with a new julia processes all the time. Here is a good general introduction to modern julia workflows.
Generally, Julia 1.9 improved that a lot with improved caching of precompiled code. So first, I would recommend using that (if you're not already doing so). With that, I get a TTFP of around 13 seconds, which is not great but not terrible...
julia> import Pkg; Pkg.activate(temp=true)
# Activating new project at `/var/folders/cx/04cwlxl9287_ndx30k6q3n1h0000gn/T/jl_4Ofxj5`
julia> Pkg.add(["Graphs", "GLMakie", "GraphMakie"])
# this might take ages
julia> @time begin
using Graphs, GLMakie, GraphMakie
g = erdos_renyi(10, 0.1)
graphplot(g)
end
# 12.330614 seconds (36.68 M allocations: 2.129 GiB, 4.68% gc time, 49.49% compilation time: 8% of which was recompilation)
Subsequent runs of the same code will take less than 7 ms.
PS: The temporary environment is just to test it on a newly created env. In practice one should obviously reuse the environment for specific project. Then you'll only pay the precompilation costs when updating packages, so the perceived startup time will be around ~13 seconds on my machine.
from graphmakie.jl.
Ah, understood, it is also not an specific issue of GraphMakie.
Thanks a lot for the nice explanation.
from graphmakie.jl.
Related Issues (20)
- curve_distance & curve_distance_usage observable not updating figure
- Precompilation stuck on Julia 1.9 HOT 6
- handle overlapping `nlabels` HOT 6
- node_color and node_marker only accept Symbol HOT 5
- Performant graph plotting and benchmarking HOT 4
- Element-wise `automatic` configuration HOT 1
- Deleting a plot doesn't remove all listeners HOT 2
- Mixing directed and undirected edges HOT 2
- Add padding around graphplot to accommodate node size. HOT 2
- `node_attr` broken using Makie v0.19.11 HOT 1
- Setting node size with ilabel
- Improve Reftests HOT 1
- provide convenience function for MetaGraphsNext HOT 7
- KeyError: key :textsize not found when running doc examples HOT 2
- UndefVarError: `mouse_selection` not defined HOT 5
- arrow_shift = :end works poorly with larger edge width HOT 6
- bounding box cuts off nodes HOT 3
- `pick` one `LineSegments` returns odd index HOT 2
- Dynamic Layout + Interaction.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphmakie.jl.