jscpd icon indicating copy to clipboard operation
jscpd copied to clipboard

Facing slowness while running JSCPD

Open Sudharshan45 opened this issue 1 year ago • 5 comments

Hi kucherenko, I am having 55,000 lines file in my repo. if we run JSCPD for that file takes more than 10 minutes. Most of the time consumes by Token generation Method name for reference (this.tokenizer.generateMaps(id, text, format, this.options); ) could please suggest solution for reduce time. Thanks in advance :)

Screenshot 2023-06-06 at 10 00 09 PM Screenshot 2023-06-06 at 10 00 56 PM

Sudharshan45 avatar Jun 07 '23 13:06 Sudharshan45

Hi @Sudharshan45 Sometimes tokenization process is slow, and I have no clear answer on how to fix it, usually, it requires more investigation of the sources.

kucherenko avatar Jun 07 '23 14:06 kucherenko

it would be very interesting to have a bit of your hardware config @Sudharshan45 just to fast check if it's not hardware related. Personally I didn't faced any issues running it on a 110k lines of codes. It was a bit long but clearly far away from 10min. My PC is a Latitude 5520. 16gigs i5

Oh, and out of curiosity, you're not on a hybrid development environment using Windows with WSL2? If it's the case, assure using jscpd in the same filesystem as where you're repo is located.

benjaminaudet avatar Aug 11 '23 15:08 benjaminaudet

I'm having a similar pain-point. jscpd is taking about 15 minutes to parse through 100k LOC. I'm running in GitHub's super-linter image.

KineticTheory avatar Aug 28 '23 19:08 KineticTheory

Hi @benjaminaudet, I am using MAC M1 16gb and running JSCPD for single js file containing 55k lines of code. I fixed that issue by slicing single file into multiple files

Sudharshan45 avatar Sep 08 '23 09:09 Sudharshan45

Hi @benjaminaudet, I am using MAC M1 16gb and running JSCPD for single js file containing 55k lines of code. I fixed that issue by slicing single file into multiple files

Just realize you were doing it on one file of 55k LOC... I mean, seems logic to me, your PC was bottlenecking at some point. Next time, make it a bit clearer that you're environment is so particular. Happy you found a solution, best wishes to you. Issue resolved.

benjaminaudet avatar Sep 08 '23 20:09 benjaminaudet