Don't warn when running interpreted js (#17529)
I'm not sure we can fix this. We need the graal compiler which doesn't appear to be jdk 8 compatible but I can't actually find javadocs for it. Its not clear from https://github.com/oracle/graaljs/blob/master/docs/user/RunOnJDK.md how you can actually run it. I tried adding the graal compiler but that seems to assume you are in a graal vm and fails not finding a class. To get a list of all the options available for a context's engine, ```clojure (doto 'metabase.pulse.render.js-engine require in-ns) (map (comp (juxt :name :help) bean) (.getOptions (.getEngine (context)))) ``` I've done some profiling ```clojure (dotimes [_ 5] (time (do (let [rows [["apples" 2] ["bananas" 3]] colors {"apples" "red" "bananas" "yellow"}] (js-svg/categorical-donut rows colors)) nil))) "Elapsed time: 210.32659 msecs" "Elapsed time: 193.211736 msecs" "Elapsed time: 190.97775 msecs" "Elapsed time: 195.843254 msecs" "Elapsed time: 188.077405 msecs" nil ``` For interpreted and in another language, this doesn't seem the end of the world. And adding more quantities ```clojure (letfn [(rand-string [] (str/join "-" (repeatedly 4 #(rand-nth ["banana" "horse" "battery" "cloak"]))))] (dotimes [_ 5] (let [rows (repeatedly 20 (fn [] [(rand-string) (rand-int 100)])) colors (zipmap (map first rows) (cycle ["red" "green" "blue" "yellow"]))] (time (js-svg/categorical-donut rows colors))))) "Elapsed time: 288.659887 msecs" "Elapsed time: 334.733071 msecs" "Elapsed time: 317.369294 msecs" "Elapsed time: 272.084918 msecs" "Elapsed time: 272.7203 msecs" nil ``` For a timeline line chart, rendering one datapoint per day for a whole year: ```clojure (dotimes [_ 5] (let [dates (take 365 (iterate #(.plusDays % 1) #t "2020")) rows (map (fn [d] [d (rand-int 200)]) dates) labels {:left "count" :bottom "year"}] (time (js-svg/timelineseries-line rows labels)))) "Elapsed time: 569.691124 msecs" "Elapsed time: 544.415676 msecs" "Elapsed time: 539.131092 msecs" "Elapsed time: 492.60486 msecs" "Elapsed time: 523.765691 msecs" nil ```
Please register or sign in to comment