Skip to content

Increase default tuple size (measurements) #1872

Open
@martijnbastiaan

Description

@martijnbastiaan

In Clash 1.4 we disabled the -flarge-tuples flag by default, as it caused problems on memory constrained machines (typically laptops). By default, Clash now generates instances up to 12-tuples which some users have noticed as a regression. We should probably pick a better default.

I've run a few benchmarks to see how different tuple sizes affect compilation time and memory usage.
Related discussion:

Graph

Updated 30th of January using 8b013f5

time_spent
memory_usage

Raw data

bench.ods

Scripts (run from contranomy)

run_bench.sh:

#!/bin/bash
rm -rf dist-newstyle

cd ../clash-compiler
git reset --hard
sed -i "s/MAX_TUPLE_SIZE 12/MAX_TUPLE_SIZE $1/g" clash-prelude/src/Clash/CPP.hs
cd -

/usr/bin/time -f "%M,%E,%x" -a -o clash_prelude_stats    cabal build clash-prelude
/usr/bin/time -f "%M,%E,%x" -a -o clash_lib_stats        cabal build clash-lib
/usr/bin/time -f "%M,%E,%x" -a -o clash_ghc_stats        cabal build clash-ghc
/usr/bin/time -f "%M,%E,%x" -a -o contranomy_build_stats cabal build contranomy:clash
/usr/bin/time -f "%M,%E,%x" -a -o contranomy_hdl_stats   cabal run contranomy:clash -- --verilog Contranomy

run_benchs.sh:

#!/bin/bash
rm -f *_stats

for ((i=13;i<=60;i++));
do
   echo ">>>>>>>>>>>> $i"
   ./run_bench.sh $i
done

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions