Bug#877418: dh-strip-nondeterminism: kills clojure performance

Emmanuel Bourg emmanuel.bourg at gmail.com
Mon Oct 2 22:34:46 UTC 2017


On Mon, 02 Oct 2017 12:00:36 +0100 Chris Lamb <lamby at debian.org> wrote:

> There's no obvious reason at this point why this performance regression is
> limited to Clojure, unless — hopefully — it's related to the .clj files?
> 
> ie. this could be affecting the performance of all Java applications
> in Debian (!)

Hey having fun with a Java puzzle and not telling the Java Team? That's
mean ;)

I quickly investigated this, it looks like the .clj files bundled in
clojure.jar are recompiled every time clojure is invoked if the jar was
processed by strip-nondeterminism. My guess was that the .clj files are
recompiled if the associated .class file is older, but it also happens
if they have the same date. I eventually found this check performed in
the load() method of RT.java:

  if((classURL != null &&
      (cljURL == null
         || lastModified(classURL, classfile) > lastModified(cljURL,
scriptfile)))

Changing '>' with '>=' fixes the issue.

Emmanuel Bourg



More information about the Reproducible-builds mailing list