Enable bytecode mode to build tezos during development
Context
This MR add a make bc
rule that will build all the Tezos binaries using OCaml bytecode, which is considerably faster to build and link.
For this a flag was added to all binaries on the Makefile except src/bin_snoop/main_snoop.exe
as it fails to build using bytecode.
Benchmarking
I ran some benchmarks, using the following setup with -j4 on dune
dune clean
dune build @check
time make
dune clean
dune build @check
time make bc
The results are
make 167.75s user 57.96s system 359% cpu 1:02.73 total
make bc 67.52s user 19.40s system 295% cpu 29.442 total
So if you're already running dune build @check -w
to type your code, when you need to build a binary it will be way faster.
Manually testing the MR
To ensure everything is working you can run:
make
file tezos-node
make bc
file tezos-node
You should see that at first it is an ELF / Mach-O
executable and after that it is a script executed by ocamlrun
Depends
To run bytecode binaries this MR depends on !2506 (merged)
Edited by Eduardo RFS