This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-02
Channels
- # aleph (3)
- # announcements (2)
- # babashka (4)
- # beginners (74)
- # calva (21)
- # clj-kondo (30)
- # cljs-dev (7)
- # cljsrn (42)
- # clojure (121)
- # clojure-dev (13)
- # clojure-europe (23)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-norway (7)
- # clojure-spec (140)
- # clojure-uk (58)
- # clojuredesign-podcast (9)
- # clojurescript (49)
- # clojutre (2)
- # cursive (32)
- # datascript (2)
- # datomic (59)
- # duct (7)
- # figwheel-main (6)
- # fulcro (18)
- # graphql (5)
- # jackdaw (1)
- # joker (6)
- # juxt (7)
- # leiningen (9)
- # off-topic (1)
- # pedestal (14)
- # quil (2)
- # re-frame (3)
- # reitit (8)
- # shadow-cljs (78)
- # sql (8)
- # timbre (3)
- # vim (69)
not sure what you'd actually gain by that async/non-blocking stuff 🙂
I get the impression that a lot of people think that async is faster. But in reality it's often slower because of the overhead. Especially in JVM land where you could use hundreds of threads if you wanted to.
@U26FJ5FDM my understanding was that the context switching that will take place with hundreds of threads will be slower as compared to the async scheduling, is that not the case ?
Could be, but it's not me experience. It's probably hard to something generic about it, since it matter a lot on how contexts and threads are implemented, and how it interacts with the 'real' cpu threads and different cpu cashes.
A noob question, are java threads different from the real CPU threads ? I thought there is a 1-1 correspondence, bcoz usually the thread pool is initialized based on the number of cores available.
on most platforms, it is 1-1 ... but if you spin up so many threads with db queries that this becomes an issue your database is long dead
most databases still run on a limited set of disks, you will peak out their i/o with a handful of queries already in most cases
nothing gets better once you tap the limit of i/o speed or disk operations per second