ultrarand
a demo of random number generation in java, and clojure via performance optimization (by joinr)
clj-fast
Unpredictably faster Clojure (by bsless)
ultrarand | clj-fast | |
---|---|---|
2 | 5 | |
4 | 230 | |
- | - | |
5.0 | 0.0 | |
over 3 years ago | about 2 years ago | |
Clojure | Clojure | |
Eclipse Public License 2.0 | Eclipse Public License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ultrarand
Posts with mentions or reviews of ultrarand.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-03-23.
-
Making the LinkedIn experimentation engine 20x faster
There's a pretty interesting discussion on primitive arrays where the user is trying to match java performance exactly with an array-based thing that's simple enough to port, but is still a hair off due to clojure's default toward longs even for indexing (java wants int for array indices, so casts are necessary). Ended up getting identical performance using JiSE here, although the clojure variant with uncheckedIntCasts was fairly close (just not "equivalent to Java" per the common trope).
-
Advent of Code 2020 Day 23 Crab Cups in Clojure (optimizing runtime from 10,000 years to 30 minutes)
There's an intersting thread on zulip regarding getting identical performance with java arrays. Normally if you're using unchecked math and working with primitives, then you should get with a hair of java (not 2-3x slower). The remaining differences are due to uncheckedIntCast since Clojure forces longs for indices and java wants ints. The difference is I'm in the realm of nanos but is there. You can eliminate it with custom bytecode like with the JISE library which is fairly painless. Example .
clj-fast
Posts with mentions or reviews of clj-fast.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-01-12.
-
Advent of Clojure - looking for feedback
IIRC clojure.core/merge is another needlessly slow implementation that gets used a lot. If you are leveraging that on hot paths you will probably see some benefit in writing your own variant or copying one (or adding a dep) from a lib that is faster. There are some explorations of these ideas in clj-fast with some early results and trends and plenty of interesting discussions in the issues.
- Notes on Optimizing Clojure Code: Overview
-
How (and When) Clojure Compiles Your Code (2016)
Noticed that code compiled in a defn as opposed to raw evaluation of the body at the repl produces different bytecode (and impacts inlining / jit) in some cases https://github.com/bsless/clj-fast/issues/16 . Kind of a cousin to the original issue you raised.
-
Making the LinkedIn experimentation engine 20x faster
Some interesting exploration in the clj-fast library and discussions in the issues there.
-
Advent of Code 2020 Day 23 Crab Cups in Clojure (optimizing runtime from 10,000 years to 30 minutes)
The only other weird performance regression with array looping code is if you test it at the repl vs inside a defined function that's called. Different bytecode emitted in each case for some reason, with the function wrapper version being substantially faster.
What are some alternatives?
When comparing ultrarand and clj-fast you can also consider the following projects:
performancepaper - A reproducible, open examination of the paper "A performance comparison of Clojure and Java" by Gustav Krantz
aoc-2021perfcomp - a fork of https://gitlab.com/slotThe/aoc-2021.git for a reddit exploration
icfpc2019
criterium - Benchmarking library for clojure
clojure - The Clojure programming language
ham-fisted - High performance HAMT
aoc-2021
AdventOfCode2022 - My solutions for AoC 2022