Good Morning!
Mornin
Good morning!
Today is a good day, I found a well fitting place to use my favourite function juxt
:rolling_on_the_floor_laughing:
Feel ya! Had a similar day once 😄
I use it fairly often! It’s great for point-free programming (though that kind of terseness can become a bit unfriendly towards readers)
But it’s fun to try to do things point-free
👋
Morning
დილა მშვიდობის!
Moinsen
Godmorgen 🙂
Morning
☀️
moin moin
mogge
morning
Goedemorgen 🙂
Er du sønderjydsk?
Nice, wide representation we got going, it seems! Nation-wise. Still mostly a bunch of white, middle aged men, it seems.
So, the last couple of many days, I’ve spent my time trying to make data.json
work as fast on reading json as cheshire
does. One might ask why do this, and I might answer, why not? One of the reasons is simply because data.json
does not depend on anything but Clojure.
It’s been a bumpy ride, with a lot of help from http://clojure-goes-fast.com, reading tons of decompiled java code and also trying to make the Clojure compiler emit the java code that I think is the fastest.
So, where am I at? For certain structures, I’m now faster than cheshire
, but, but the bottleneck seems to be at parsing Strings (which is a big part json). The “hot code” is right here
https://github.com/slipset/data.json/blob/no-dymic-vars-only/src/main/clojure/clojure/data/json.clj#L135
and as far as I can see there are several reasons why I can’t make this faster:
1. I haven’t figured out how to have an unsynchronized-mutable
int
. This is problematic because every array lookup now calls RT.intCast
because java-arrays must be looked up with ints and not longs
2. The Clojure compiler doesn’t seem to be very interested in the fact that char
s are native types, so it doesn’t want to emit fast, native based code when dealing with char
s, only when dealing with int
’s
So, if anyone has any tips in these areas, I’d be super happy 🙂
This won’t help you right now, but this made me wonder how much potential there is, once the Value Types / Inline Types from Project Valhalla are available.
Rewrite parts in Java. IMO doesn't make sense to spend a ton of time optimizing non-idiomatic Clojure code which is just a few lines in Java
No offence to anyone, btw, just an observation 🙂
I thought the same as @borkdude (I have no experience in that level of optimization, though)
httpkit (client + server) and jsonista do this too: core in Java, API in Clojure
I take offence at the middle aged 😄
Ha!, just by writing this, I solved one of my problems 🙂
@slipset Nice idea though, it would be nice to have a minimal and fast JSON lib in pure Java + Clojure a la httpkit
Quack quack, then! :duckie: :duckie: :duckie:
🙂
I completely fall into that description
the blog post goes into some of the java-y bits https://www.metosin.fi/blog/faster-json-processing-with-jsonista/
The point of slipset's exercise is to have a JSON lib that only depends on clojure. Both cheshire and jsonista depend on Jackson
right, was just as a point of comparison or inspiration maybe 🙂
right
Joking aside, Europe is full of white people. And in my job postings I got 1-2 women in total applying out of 100 or so candidates. I've no idea of the underlying distribution to see if the kind of applicants I get are representative or not, and I want to do better. Any pointers or information welcome!
I’m surprised to hear that you had women/woman! That’s great. I’ve been fortunate enough to work directly with 3 female developers so far in my career, and it’s been awesome. Hope you get to see more female applicants later on. I’m aware that there’s a difference between distributions of white people in e.g. Denmark and the US, where these issues tend to flare up more 😉 Sometimes the excitement spills over into Denmark, like with the recent Black Lives Matter thing, and people forget that while there are problems of that kind here, too, it’s a completely different country in so many regards.
I’m ashamed to admit it, but I was like 20yo when I first saw a black person in a suit up close (in London). Up until then the only black people in Greece were unlucky African immigrants who got stuck. I’ve been working hard on my biases since :)
Similar thing for me. I’m not really ashamed, those were just the circumstances I grew up in - mostly white people, few suit wearers in general 🙂 Think about my biases often.
I think I'm mostly ashamed of how ignorant I was back then, but yeah given the environment it was kinda unavoidable...