This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-09
Channels
- # announcements (23)
- # babashka (7)
- # beginners (69)
- # biff (5)
- # calva (12)
- # cider (10)
- # cljfx (9)
- # clojure (60)
- # clojure-austin (1)
- # clojure-europe (14)
- # clojure-korea (2)
- # clojure-losangeles (2)
- # clojure-madison (1)
- # clojure-nl (1)
- # clojure-norway (23)
- # clojure-uk (7)
- # clojuredesign-podcast (16)
- # clojurescript (40)
- # datomic (8)
- # gratitude (4)
- # mount (3)
- # nrepl (2)
- # off-topic (38)
- # pathom (3)
- # releases (1)
- # ring (8)
- # shadow-cljs (7)
Hi everyone 👋 I came across this claim in the docs of smart maps: > Preload data > If you know the attributes you will need ahead of time, it's more efficient to load then in a single run than fetching one by one lazily. > Does anyone know the reason behind this claim? If the results are cached during lookup why is it more efficient to calculate them ahead of time? I'm guessing it's still runtime (i.e no compile-time like macro expansion), and the amount of work to be done is the same. Maybe it means you can do it ahead of time if you have idle time and that would be more efficient use of your time?
This is likely an advice based on implementation, but resolvers in pathom are either returning several attributes or just one each. When a smart map is used, it is likely better to resolve all the attributes at once, because multiple calls could resolve all attributes several times.