<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Questions without answers in test.check</title>
<link>https://ask.clojure.org/index.php/unanswered/contrib-libs/test-check</link>
<description></description>
<item>
<title>Allocation churn on generators</title>
<link>https://ask.clojure.org/index.php/14721/allocation-churn-on-generators</link>
<description>&lt;p&gt;When generating moderately large values there is some LazySeq churn that could be avoided. For example, the following snippet allocates over 15GB (measured with async-profiler):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(core/let [g (vector (not-empty string-alphanumeric) 1000 5000)]
  (time
   (dotimes [seed 50]
     (dorun (generate g 100 seed)))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The pattern of generating multiple (increasingly larger) values is common with quick-check (via deftest et al).&lt;/p&gt;
&lt;p&gt;Many generators are built on top of &lt;code&gt;choose&lt;/code&gt;, and there is an opportunity to reduce churn by special casing &lt;code&gt;shrink-int&lt;/code&gt; for longs (which should be the common case compared to big ints).&lt;/p&gt;
&lt;p&gt;I have a patch that decreases total allocations of the repro above by ~15% and speed up the run time by ~25% (measured on jdk 25, with &lt;code&gt;-Xmx512m -XX:+UseSerialGC&lt;/code&gt; to decrease variance). Happy to share it.&lt;/p&gt;
</description>
<category>test.check</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14721/allocation-churn-on-generators</guid>
<pubDate>Tue, 07 Oct 2025 21:16:10 +0000</pubDate>
</item>
<item>
<title>Let RoseTree satisfy (implement) Datafiable</title>
<link>https://ask.clojure.org/index.php/9412/let-rosetree-satisfy-implement-datafiable</link>
<description>&lt;p&gt;I think for debugging it would be awesome to be able to navigate through the rose trees.&lt;/p&gt;
</description>
<category>test.check</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9412/let-rosetree-satisfy-implement-datafiable</guid>
<pubDate>Thu, 02 Jul 2020 18:36:54 +0000</pubDate>
</item>
</channel>
</rss>