trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.31k forks source link

high cpu and memory usage #3509

Open Komari-Koshigaya opened 3 years ago

Komari-Koshigaya commented 3 years ago

It takes more than 7 seconds when I run the commands-truffle inittruffle test and others, along with high cpu and memroy usage from 1% to 80%. Especially, 10 seconds with truffle -v and reinstallation doesn't work.


Environment

elenadimitrova commented 3 years ago

I've been meaning to log something along the lines of poor performance but just adding it here. It takes ~4mins on a brand new top spec macbook pro between when compilation finishes and the test suite starts running for https://github.com/argentlabs/argent-contracts , you can reproduce on the experiment/migrate-to-truffle branch by running truffle test. It's really not workable on a day-to-day basis. I've also tried node 8 and node 10 with the same poor performance result.

Truffle v5.1.52 (core: 5.1.52) Solidity - 0.6.12 (solc-js) Node v12.19.0 Web3.js v1.2.9

eggplantzzz commented 3 years ago

Thanks for the reports both of you, we would definitely like to figure out what is causing such a slow startup. We plan on looking into this soon to see if we can make improvements!

haltman-at commented 3 years ago

Earlier: #3142, #2038. Should we close those in favor of this?

eggplantzzz commented 3 years ago

I have no problem with that @haltman-at. Is there any info in those PRs that is helpful to preserve?

elenadimitrova commented 3 years ago

A gentle nudge as this is one of the two blockers to move the argent-contracts repo to truffle.

tinysnowman commented 3 years ago

I am a beginner, but I am seeing the same problem.

I tried a couple of different versions of node.

For about 8 seconds it does nothing, before returning versions (or outputting anything for any other command).

$ date; truffle version; date Thu 10 Dec 2020 05:04:39 PM GMT Truffle v5.1.56 (core: 5.1.56) Solidity v0.5.16 (solc-js) Node v14.15.1 Web3.js v1.2.9 Thu 10 Dec 2020 05:04:47 PM GMT

$ cat /etc/lsb-release | tail -1 DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"

tucano2 commented 3 years ago

FWIW - same issue also observed on:

DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"

drortirosh commented 3 years ago

We tried to update truffle from 5.1.26 to the latest (5.1.65) Our tests now take over 12 minutes, instead of 5 min, with nothing else changed. We reverted back to 5.1.26 ...

haltman-at commented 3 years ago

@drortirosh Do you know what version this problem first occurs on? Thank you!

blockchainguyy commented 3 years ago

Think this is something similar so adding here:

For a large number of tests where a lot of them are using web3, truffle test cases hang indefinitely for me after v5.1.35:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic

Other environment settings:

Node: v12.16.1 ​(I have also tried with v14)
npm 7.7.4
Truffle v5.2.6 (core: 5.2.6)
Solidity - 0.5.9 (solc-js)
Node v12.16.1
Web3.js v1.2.9

It starts working if I switch to truffle v5.1.35:

Truffle v5.1.35 (core: 5.1.35)
Solidity - 0.5.9 (solc-js)
Node v10.15.0
Web3.js v1.2.1

I think it can also be a problem with the web3 version latched with truffle. As I see the version with web3 v1.2.1 works well, but v1.2.9 does not.

eggplantzzz commented 2 years ago

Can anyone confirm that this is still an issue with Truffle? Over the past year we have made some significant steps forward with getting Truffle's speed up. If anyone has any feedback about the most recent version (v5.6.0) I would love to hear about it!