“Truffle compile” so slow — solc is much faster

Viktor Nosov
Coinmonks
Aug 31, 2017

--

Truffle compile speed

When we use truffle framework and compile ethereum solidity smart contracts with “truffle compile” command, actually we use javascript version of solidity compiler. But solidity compiler works very slow, for instance compiling of ~20 .sol files takes about 2 minutes.

Simple solution is to use solc binary package, that works much faster. You can install this package by commands:

sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc

But next, we must dump compiled EVM bytecode to truffle build files, located in build/contract folder. We can do this by simple javascript script:

Now compilation of the same files takes only 10s ( vs 96s using javascript solidity compiler)

https://github.com/vitiko/truffle-fast-compile — command line utility for compiling solidity contracts via solc binary packag

--

--