You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've made a Pluto notebook which reads the shapes of all countries (using Shapefile) from Natural Earth and renders them, thus creating a world map.
I've used AoG for this purpose but implemented the same script also using the following packages:
MeshViz which is (like AoG) based on Makie
Gadfly
Plots
Code using AoG
using AlgebraOfGraphics, GLMakie
using Shapefile, ZipFile
using Downloads: download
zipfile =download("https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip")
r = ZipFile.Reader(zipfile);
for f in r.files
println("Filename: $(f.name)")
open(f.name, "w") do io
write(io, read(f))
endendclose(r)
countries = Shapefile.Table("./ne_110m_admin_0_countries.shp")
plt =geodata(countries) *mapping(:geometry, color =:NAME_ID) *visual(Poly)
fg =draw(plt, legend=(position=:top,); axis=(width =1400, height =900))
Versioninfo:
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU: Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, westmere)
Surprisingly, the different implementations showed vastly differing run time performances for drawing the map (consisting of 290 polygons). As in almost all Julia programs the first execution is much slower than on follow up runs, I measured execution times for the first as well as for the next run of each script and got the following numbers (all times are in seconds):
Implementation
1st run
2nd run
AoG + GLMakie
96
50
AoG + CairoMakie
95
50
MeshViz + GLMakie
55
2.5
MeshViz + CairoMakie
54
3
Plots
2
0.1
Gadfly
1
< 0.001
As can bee seen all Makie-based implementations are generally slower (why?). But there is also a noticeable difference between AoG and MeshViz, despite being based on Makie in both cases. Especially on the 2nd run AoG lacks the speedup which can be seen in MeshViz.
So I wonder if anything can be changed in my implementation using AoG to get a better performance?
The text was updated successfully, but these errors were encountered:
I've looked into this just now and while the times are better on my machine, they're still bad. I did this:
@timebegin
plt =data(countries) *mapping(:geometry, color =:NAME_ID) *visual(Choropleth)
fg =draw(plt, scales(Color = (; legend =false)), legend=(position=:top,))
display(fg)
end
Note the Color = (; legend = false). Without that (so with the legend showing) I get 7.962373 seconds (53.77 M allocations: 2.181 GiB, 3.35% gc time, 0.00% compilation time). With it (so no legend) I get 0.194179 seconds (678.70 k allocations: 56.869 MiB, 18.62% gc time, 0.00% compilation time). So the slowness here is basically all legend. Of course, there are 177 legend entries, which is a lot, so the underlying slowness of Legend is compounded, probably quadratically.
I'll close this here as I'm pretty sure the issue is on Makie's side.
I've made a Pluto notebook which reads the shapes of all countries (using
Shapefile
) from Natural Earth and renders them, thus creating a world map.I've used AoG for this purpose but implemented the same script also using the following packages:
MeshViz
which is (like AoG) based on MakieGadfly
Plots
Code using AoG
Versioninfo:
Surprisingly, the different implementations showed vastly differing run time performances for drawing the map (consisting of 290 polygons). As in almost all Julia programs the first execution is much slower than on follow up runs, I measured execution times for the first as well as for the next run of each script and got the following numbers (all times are in seconds):
As can bee seen all Makie-based implementations are generally slower (why?). But there is also a noticeable difference between AoG and MeshViz, despite being based on Makie in both cases. Especially on the 2nd run AoG lacks the speedup which can be seen in MeshViz.
So I wonder if anything can be changed in my implementation using AoG to get a better performance?
The text was updated successfully, but these errors were encountered: