This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-30
Channels
- # announcements (1)
- # asami (21)
- # babashka (10)
- # beginners (123)
- # cider (55)
- # cljfx (9)
- # clojure (21)
- # clojure-europe (25)
- # clojure-nl (4)
- # clojure-uk (6)
- # clojured (1)
- # clojurescript (29)
- # cursive (9)
- # datomic (8)
- # emacs (13)
- # events (1)
- # fulcro (21)
- # graalvm (10)
- # graalvm-mobile (13)
- # jobs (1)
- # luminus (4)
- # malli (7)
- # nrepl (9)
- # off-topic (24)
- # pathom (2)
- # podcasts-discuss (1)
- # reagent (5)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (33)
- # tools-deps (60)
- # vim (8)
- # xtdb (1)
I'm looking for a clojure library that implements a disk-backed LRU cache -- any suggestions? I'm reading many millions of records from a database and need to manipulate/mangle them and I'm running out of memory in the jvm process. (option B is mucking around with jvm memory settings, but if there's a clojure-friendly caching solution available I'm guessing it might be the more scalable and potentially simpler solution.)
Not a cache directly but Chronicle Map might be helpful: https://github.com/OpenHFT/Chronicle-Map
https://github.com/ben-manes/caffeine Very well designed library.
What kind of manipulation are we talking about?
Are you able to deterministically paginate your queries from the database? Not sure what kind of mangling you're doing (e.g. if all that data is required to be in memory/cache at once)
(btw, was looking at org.clojure/cache.core
-- did I overlook an implementation in that lib that reads from/writes to disk?)
core.cache
is all in-memory.
I have a question about java interop. Do typecasts happen automatically? Am trying to understand how it is handled under the hood. Say, char-array, which calls (. clojure.lang.Numbers char_array size init-val-or-seq)
and thus maps to static public char[] char_array(int size, Object init){
in Numbers.java. One can pass a Long as the size, but the signature for this method expects an int, which > Integer/MAX_VALUE results in an overflow. Do all interop calls attempt to coerce the inputs?
(This is just a followup on a nasty bug I encountered, where I was using arbitrarily-sized byte-arrays to store temporary data, and did not know that JVM arrays were int-indexed. I am wondering if this behaviour is general with interop. Also where is the best place to put a note or warning about such things. I don't have commit access, but it might be useful for int-indexed to be referenced in the docstring at least. Not sure who to ask about this sort of thing.)
The best place to ask questions like this is at https://ask.clojure.org
in general, most Java things are int-indexed (arrays and collections) and Clojure defaults to longs for integer values
most people don't have more than max int number of things in either of those, so this difference is not obvious
the situation with arity/type matching/casting is complicated, some info at https://clojure.org/reference/java_interop, https://clojure.org/reference/reader#_literals
What's that Clojure talk where Rich discusses semver and how any API or breaking changes should be a separate file, function, or library?
Spec-ulation