This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-30
Channels
- # asami (4)
- # babashka (3)
- # beginners (21)
- # biff (22)
- # cljs-dev (6)
- # clojure (11)
- # clojure-europe (3)
- # clojure-norway (35)
- # clojure-spain (4)
- # clojurescript (14)
- # datalevin (2)
- # emacs (12)
- # exercism (2)
- # fulcro (10)
- # honeysql (4)
- # humbleui (3)
- # hyperfiddle (49)
- # instaparse (1)
- # introduce-yourself (1)
- # missionary (1)
- # off-topic (109)
- # pathom (2)
- # practicalli (21)
- # random (2)
- # rdf (2)
- # releases (2)
- # scittle (3)
- # specter (2)
Being somewhat inspired by @chris441’s conj talk, I’m trying to speed things up.
However, I’m stumbling upon a conundrum. Using the output from https://github.com/clojure-goes-fast/clj-java-decompiler to observe my findings, it seems to me that I’m not able to typehint an argument to deftype
as a char-array:
(deftype Foo [^{:tag char} bar])
gives
public final class Foo implements IType
{
public final char bar;
public Foo(final char bar) {
this.bar = bar;
}
...
}
whereas
(deftype Foo [^{:tag chars} bar])
gives
public final class Foo implements IType
{
public final Object bar;
public Foo(final Object bar) {
this.bar = bar;
}
}
What am I missing?@U04V5VAUN I too was inspired by @chris441 talk. What are you trying to speed up?
I would assume https://github.com/clojure/data.json, am I right @U04V5VAUN?
@U04V5VAUN if you do speed up data.json, let me know. I straight up copied it for my java library so optimizations are likely tranferrable
Here’s the work in progress https://github.com/slipset/data.json/tree/with-char-reader
https://github.com/cnuernber/charred
I assume that you may have already seen this library (also by @chris441) but in case anyone is interested in prior art / a drop-in high-performance replacement for data.json
, this one has no external dependencies, so it's easier to understand in a self-contained way.