<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged 1.12.1 regression</title>
<link>https://ask.clojure.org/index.php/tag/1.12.1%20regression</link>
<description>Powered by Question2Answer</description>
<item>
<title>Rose Tree Children Appear to be Eagerly Evaluated (Clojure 1.12+)</title>
<link>https://ask.clojure.org/index.php/15226/rose-tree-children-appear-to-be-eagerly-evaluated-clojure-12</link>
<description>&lt;p&gt;To make a long story shorter, I&#039;ve been aggressively profiling the generative tests I rely on on a daily basis. In CI, they run on memory-constrained machines which have occasionally ended up in OOM states that cause our test executor to kill the nodes running some generative tests. In many cases, we&#039;ve been able to adjust sizing to get under the line and resume normally. I&#039;ve been running into that case more frequently, and have been looking for potential causes/levers to adjust in the source code.&lt;/p&gt;
&lt;p&gt;The below findings are from my relatively powerful Macbook:&lt;/p&gt;
&lt;p&gt;Operating System: MacOS (Tahoe - AArch64)&lt;br&gt;
Clojure version: Verified on 1.12.1, Compared against 1.11.4&lt;br&gt;
JDK vendor and version: OpenJDK 21.0.11&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Using &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure-goes-fast/clj-async-profiler&quot;&gt;&lt;code&gt;clj-async-profiler&lt;/code&gt;&lt;/a&gt; and an allocation/timing macro from &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure-goes-fast.com/kb/benchmarking/time-plus/&quot;&gt;Clojure Goes Fast&lt;/a&gt;, I benchmarked &lt;code&gt;clojure.test.check.generators&lt;/code&gt; against some pretty common generators (Assume I&#039;m using &lt;code&gt;gen&lt;/code&gt; as an alias for that namespace):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;gen/string&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gen/large-integer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(gen/map gen/keyword gen/string)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While benchmarking, &lt;code&gt;ReentrantLock&lt;/code&gt; (and &lt;code&gt;ReentrantLock$NonfairSync&lt;/code&gt;), accounted for ~1/3rd of all allocations. Since Clojure 1.12, each &lt;code&gt;LazySeq&lt;/code&gt; also allocates a &lt;code&gt;ReentrantLock&lt;/code&gt;, so I reran the benchmarking after downgrading to Clojure 1.11.4 Obviously, all of those object references were no longer in the profiler results, but the amount of bytes allocated did consistently shrink (~10-15%, depending on the generator).&lt;/p&gt;
&lt;p&gt;Most of the allocation appears to be happening while constructing the children segments of nodes in the rose tree. To my knowledge, we only ever lean on the full tree when shrinking results, and wouldn&#039;t read them on a generate-only pass. To test that, I wrapped the &lt;code&gt;children&lt;/code&gt; arguments to a few of the &lt;code&gt;make-rose&lt;/code&gt; calls in the call tree for string generation, and re-instrumented on v.12.1&lt;/p&gt;
&lt;p&gt;This approximated the same reduction in memory use as downgrading to 1.11.4, and wiped out almost all of the &lt;code&gt;ReentrantLock&lt;/code&gt; allocation events. I&#039;ve been able to verify the fix does not break any tests, and that shrinking is functional as well.&lt;/p&gt;
&lt;p&gt;For posterity / reproduction, the specific call sites I wrapped the &lt;code&gt;children&lt;/code&gt; in were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;clojure.test.check.rose-tree&lt;/code&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;join&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fmap&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shrink&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shrink-vector*&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;clojure.test.check.generators&lt;/code&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;int-rose-tree&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Happy to share the profiler output / git patch if anyone is interested!&lt;/p&gt;
</description>
<category>test.check</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15226/rose-tree-children-appear-to-be-eagerly-evaluated-clojure-12</guid>
<pubDate>Mon, 31 Aug 2026 18:18:35 +0000</pubDate>
</item>
<item>
<title>Is the ant build broken in Clojure 1.12.1?</title>
<link>https://ask.clojure.org/index.php/14567/is-the-ant-build-broken-in-clojure-1-12-1</link>
<description>&lt;p&gt;I have an old script that gets the Clojure source from github and calls &lt;code&gt;./antsetup.sh&lt;/code&gt; and then &lt;code&gt;ant&lt;/code&gt; to build and test.  With Clojure 1.12.1, it fails trying to compile the recently modified SwissArmy.java.  My work-around was to modify the build.xml so that the java compiler would see the build directory on the classpath.  (It&#039;s likely there&#039;s a better fix. I&#039;m no expert with ant.)&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;diff --git a/build.xml b/build.xml index 1464b69e..8ce4a961 100644&lt;br&gt;
--- a/build.xml&lt;br&gt;
+++ b/build.xml @@ -99,6 +99,7 @@&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;       unless=&quot;maven.test.skip&quot;&amp;gt;
 &amp;lt;mkdir dir=&quot;${test-classes}&quot;/&amp;gt;
 &amp;lt;javac srcdir=&quot;${jtestsrc}&quot; destdir=&quot;${test-classes}&quot; includeJavaRuntime=&quot;yes&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;classpath=&quot;${maven.test.classpath}:${build}&quot;&lt;pre&gt;&lt;code&gt;        debug=&quot;true&quot; source=&quot;1.8&quot; target=&quot;1.8&quot; includeantruntime=&quot;no&quot;/&amp;gt;
 &amp;lt;echo&amp;gt;Direct linking = ${directlinking}&amp;lt;/echo&amp;gt;
 &amp;lt;java classname=&quot;clojure.lang.Compile&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think it&#039;s probably better to use &lt;code&gt;mvn test&lt;/code&gt; in my script as I&#039;m only making sure I can build Clojure from source.  However, technically this looks like a regression and it may break some old automation.  Perhaps, ant is more trouble than it&#039;s worth at this point.  Up to you. I&#039;m fine with dropping support.  I just wanted to point out the issue so you were aware of it.&lt;/p&gt;
</description>
<category>Compiler</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14567/is-the-ant-build-broken-in-clojure-1-12-1</guid>
<pubDate>Tue, 03 Jun 2025 14:26:14 +0000</pubDate>
</item>
</channel>
</rss>