Hi, Dali is beautiful, and I love it; however, the performance on render is very poor. Rendering a 46Mb SVG file too eight hours fifteen minutes, vs 16.7 seconds with hiccup.
The change is here.
The timings are as follows:
Before the change:
walkmap.core=> (time (def f (binary-stl-file-to-svg "../the-great-game/resources/maps/heightmap.stl" "resources/heightmap.svg")))
"Elapsed time: 2.969569560662E7 msecs"
After the change:
walkmap.core=> (time (def f (binary-stl-file-to-svg "../the-great-game/resources/maps/heightmap.stl" "resources/heightmap.svg")))
"Elapsed time: 16724.848222 msecs"
I think the issue must be with rendering the :points attribute of the :polygon element; in the Dali version I used:
(defn- facet-to-svg-poly
[facet]
(vec
(cons
:polygon
(map #(vec (list (:x %) (:y %))) (:vertices facet)))))
Whereas in the Hiccup version I use
(defn- facet-to-svg-poly
[facet]
[:polygon
{:points (s/join " " (map #(str (:x %) "," (:y %)) (:vertices facet)))}])
But the time penalty happens not during the execution of this function but during dali.io/render-svg.
Hi, Dali is beautiful, and I love it; however, the performance on render is very poor. Rendering a 46Mb SVG file too eight hours fifteen minutes, vs 16.7 seconds with hiccup.
The change is here.
The timings are as follows:
Before the change:
After the change:
I think the issue must be with rendering the
:pointsattribute of the:polygonelement; in the Dali version I used:Whereas in the Hiccup version I use
But the time penalty happens not during the execution of this function but during
dali.io/render-svg.