deadfile icon indicating copy to clipboard operation
deadfile copied to clipboard

Hangs on a big project

Open OnkelTem opened this issue 5 years ago • 15 comments

(develop *+$% u=)$ deadfile ./src/root.jsx 

   ╭──────────────────────────────────────────────────────────────╮
   │                                                              │
   │                          Dead File!                          │
   │                                                              │
   │   Simply find the unused files in your javascript project.   │
   │                    Press --help for help.                    │
   │                                                              │
   ╰──────────────────────────────────────────────────────────────╯

✔ 3152 total assets found in base directory.
⠙ 16 imported assets found. /path/to/the/project/src/state/routes.jsx Killed

Tried two times. Every time I had to kill the process after 4-6 minutes. Weirdly, I couldn't also terminate the process using Ctrl+c so I killed it from the outside.

Both times the process was consuming 175-200% of CPU according to htop.

System: Linux Ubuntu 18.04

OnkelTem avatar Feb 17 '20 16:02 OnkelTem

/summon @M-Izadmehr

OnkelTem avatar Feb 17 '20 16:02 OnkelTem

Not sure what the deal is, I even used the cli option that narrows it down to directory. I pointed it to a directory with 3 .tsx file (within a large project) and still stuck. The node process sucks up all my CPU processing power and my macbook sounds like it's about to take off.

kamok avatar Feb 17 '20 20:02 kamok

Thanks a lot for taking the time and reporting this issue:) I actually tested this library on a super big library (over 200,000 lines of code), however, to be honest, I mostly checked with javascript, I guess this issue is only with typescript projects, I will try to look into this and resolve this. Even if it requires more process, it should not block the main process.

M-Izadmehr avatar Feb 18 '20 17:02 M-Izadmehr

Hi

Same issue for me, in a javascript project (and I only test javascript, there is nothing else there).

I tried to mark only the specific directory and the index.js file, but nothing worked. It starts hanging at the "220 imported assets found." stage.

raphaellueckl avatar Mar 13 '20 13:03 raphaellueckl

Same here :(

✔ 1540 total assets found in base directory.
⠦ 446 imported assets found. /Volumes/dev-image/.../RandomFile.js 

subtleGradient avatar Apr 14 '20 16:04 subtleGradient

Same here :(

✔ 582 total assets found in base directory.
⠋ 231 imported assets found. /path/to/file/File.jsx 

mustyoshi avatar Apr 22 '20 18:04 mustyoshi

Same:

✔ 1862 total assets found in base directory.
⠏ 695 imported assets found. /Users/sunway/Documents/Project/ShopDiary/src/component/SlideFilterComponent.js 

nsyujian avatar Apr 23 '20 03:04 nsyujian

I've got this working on a large project but it's reporting 90% of files as dead, while I know that they're included. This is using deadfile ./src/index.tsx

simonv3 avatar May 14 '20 20:05 simonv3

+1, can confirm, I'm also experiencing this in a semi-large project with a mixed JS(X)/TS(X) codebase.

laustdeleuran avatar May 19 '20 23:05 laustdeleuran

This might be a duplicate of https://github.com/M-Izadmehr/deadfile/issues/4

laustdeleuran avatar May 20 '20 18:05 laustdeleuran

Thanks for the report, Sorry I was not active in the past few months. I just made a small release (version 1.2), it should be resolved. Could you possibly confirm it in your project?

M-Izadmehr avatar Jun 27 '20 16:06 M-Izadmehr

Using deadfile 1.2.2 with a React typescript codebase I had the same issue as simonv3

598 total files found!
595 dead files found!

asavage1 avatar Feb 24 '21 02:02 asavage1

Happy to report that our large project with ~560 files is now finishing

mustyoshi avatar May 07 '21 20:05 mustyoshi

I encountered this issue and I resolved by this way:

  • Replace all import 'alias' to your absolute path. eg: '.src/' -> '/Users/sunway/Documents/Project/ShopDiary/src/'
  • Run deadfile command
  • Delete all unused files
  • Replace all absolute paths to your alias

joepake avatar Oct 26 '22 06:10 joepake

@joepake What kind of alias do you use (webpack/npm/...)?

M-Izadmehr avatar Oct 30 '22 18:10 M-Izadmehr