Skip to content
Snippets Groups Projects
Unverified Commit 743ae09a authored by Oleksandr Yakushev's avatar Oleksandr Yakushev Committed by GitHub
Browse files

perf: [insights] Use direct conversions in ->millis-from-epoch to avoid...

perf: [insights] Use direct conversions in ->millis-from-epoch to avoid clojure.java-time overhead (#47145)
parent 49358630
No related branches found
No related tags found
No related merge requests found
......@@ -178,9 +178,9 @@
(defn- ->millis-from-epoch [t]
(when t
(condp instance? t
Instant (t/to-millis-from-epoch t)
OffsetDateTime (t/to-millis-from-epoch t)
ZonedDateTime (t/to-millis-from-epoch t)
Instant (.toEpochMilli ^Instant t)
OffsetDateTime (.toEpochMilli (.toInstant ^OffsetDateTime t))
ZonedDateTime (.toEpochMilli (.toInstant ^ZonedDateTime t))
LocalDate (->millis-from-epoch (t/offset-date-time t (t/local-time 0) (t/zone-offset 0)))
LocalDateTime (->millis-from-epoch (t/offset-date-time t (t/zone-offset 0)))
LocalTime (->millis-from-epoch (t/offset-date-time (t/local-date "1970-01-01") t (t/zone-offset 0)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment