Fork me on GitHub
#clojure-italy
<
2017-07-22
>
nilrecurring19:07:41

Benvenuti! 🙂

nilrecurring19:07:31

EuroClojure è finita, si rientra a casa, e arriva la solita malinconia post-conferenza

nilrecurring19:07:27

È sempre molto bello rivedere tante facce note e incontrarne tante nuove 🙂

nilrecurring19:07:43

I talks non troppo convincenti in media, eccetto qualche perla molto bella (e.g. il keynote). Ho preso delle note+commenti, che spero di riuscire a sistemare e pubblicare asap

nilrecurring20:07:55

E sono contento di aver reclutato @richiardiandrea nel canale 😄

nilrecurring20:07:18

A proposito, ieri sera grazie a qualche paio di birre abbiamo investigato qualche altra curiosità riguardo alle microperformances: first è più lenta di nth 0 sui vettori, ma succede l’opposto sulle liste

nilrecurring20:07:15

;; Vectors
boot.user=> (def a (into [] (range 1000)))
#'boot.user/a
boot.user=> (time (dotimes [i 1000000] (nth a 0))) ;; nth
"Elapsed time: 15.138612 msecs"
nil
boot.user=> (time (dotimes [i 1000000] (first a))) ;; first
"Elapsed time: 75.107362 msecs"
nil
boot.user=> (time (dotimes [i 1000000] (get a 0))) ;; get
"Elapsed time: 31.465566 msecs"
nil
boot.user=> (time (dotimes [i 1000000] (.get a 0))) ;; java interop, reflection
"Elapsed time: 4594.820928 msecs"
nil
boot.user=> (def ^java.util.List  a (into [] (range 1000)))
#'boot.user/a
boot.user=> (time (dotimes [i 1000000] (.get a 0))) ;; interop, no reflection
"Elapsed time: 23.497538 msecs"
nil

;; Liste
boot.user=> (def b (into '() (range 1000)))
#'boot.user/b
boot.user=> (time (dotimes [i 1000000] (.get b 0)))
"Elapsed time: 3108.644045 msecs"
nil
boot.user=> (time (dotimes [i 1000000] (nth b 0 )))
"Elapsed time: 197.009824 msecs"
nil
boot.user=> (time (dotimes [i 1000000] (first b)))
"Elapsed time: 22.120821 msecs"
nil
boot.user=>

richiardiandrea20:07:41

Moto felice di averti conosciuto @nilrecurring e ottimo report per quel che riguarda le performance, magari @bronsa ci può illuminare sul perché 😀