Clojure, Faster

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • criterium

    Benchmarking library for clojure

  • Criterium (the benchmarking library used here) uses multiple runs to obtain tighter bounds on amortized performance, as well as techniques to amortize the effects of garbage collection and JIT compilation. See https://github.com/hugoduncan/criterium for a brief overview, as well as links to the pitfalls and statistical techniques involved in JVM benchmarking.

  • clojure

    The Clojure programming language

  • In short: it's slow because there isn't just one kind of Java array, and if you don't say which one you mean, Clojure has to do reflection to figure it out.

    Inside the JVM, there are several different types of arrays: bytes, floats, objects, etc. Clojure.lang.RT includes methods for getting the length of all of these types--for instance, here's the method for the length of arrays of longs:

    https://github.com/clojure/clojure/blob/master/src/jvm/cloju...

    The clojure.core/alength function calls clojure.lang.RT/alength, but that callsite is polymorphic: the Clojure compiler doesn't know which of the RT functions to emit a call for, because it needs the type signature. If the type is unavailable at compile time, the Clojure compiler emits reflective code which inspects the type of the reference, determines which specific clojure.lang.RT/alength implementation to dispatch to, then executes that call dynamically. That's the slow part!

    https://github.com/clojure/clojure/blob/clojure-1.10.1/src/c...

    Just like the article says, if you include a type hint, the compiler can emit an invokestatic call directly to, say, clojure.lang.RT.alength(long[]), and skip all the reflection.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • How to Debug Failing Build Agent Pods in Kubernetes-enabled Jenkins

    1 project | dev.to | 3 May 2024
  • Stirling PDF: Self-hosted, web-based PDF manipulation tool

    2 projects | news.ycombinator.com | 2 May 2024
  • Ask HN: Best stack for building a desktop app?

    5 projects | news.ycombinator.com | 1 May 2024
  • Open VSX – Extensions for VS Code Compatible Editors

    1 project | news.ycombinator.com | 2 May 2024
  • LLM Based Input Space Partitioning Testing for Library APIs (a.k.a. Bogus CVEs)

    1 project | news.ycombinator.com | 2 May 2024