terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.85k stars 250 forks source link

Latest release made it considerably slower #253

Closed ishepard closed 5 years ago

ishepard commented 5 years ago

Hi @terryyin, thank you for the tool, very cool and useful!

I have a small remark though: with the latest release, the tool became considerably slower. As a test, I called lizard.analyze_file.analyze_source_code() on 3910 files, and these are the statistics:

# lizard v1.15.7
Analyzed 3910 files in 0:2:25 

# lizard v1.16.1
Analyzed 3910 files in 0:24:40 

As you can see, we moved from 2 minutes to 24 😕

Not an urgent problem, I am gonna stick with Lizard==1.15.7, but just to let you know 😄

terryyin commented 5 years ago

Well, that is not acceptable. Thanks for letting me know. I will revert and make a new version and then test the new feature again before releasing.

On 11 Feb 2019, at 7:49 PM, Spadini Davide notifications@github.com wrote:

Hi @terryyin https://github.com/terryyin, thank you for the tool, very cool and useful!

I have a small remark though: with the last release, the tool became considerably slower. As a test, I called lizard.analyze_file.analyze_source_code() on 3910 files, and these are the statistics:

lizard v1.15.7

Analyzed 3910 files in 0:2:25

lizard v1.16.1

Analyzed 3910 files in 0:24:40 As you can see, we moved from 2 minutes to 24 😕

Not an urgent problem, I am gonna stick with Lizard==1.15.7, but just to let you know 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/253, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwJYsEklyP5cduMqbvHZSRh7MjhPcSRks5vMVjbgaJpZM4a0BkX.

terryyin commented 5 years ago

It will be great if you can confirm that 1.16.2 has restore the speed.

On 11 Feb 2019, at 8:30 PM, Terry Yin terry@odd-e.com wrote:

Well, that is not acceptable. Thanks for letting me know. I will revert and make a new version and then test the new feature again before releasing.

On 11 Feb 2019, at 7:49 PM, Spadini Davide <notifications@github.com mailto:notifications@github.com> wrote:

Hi @terryyin https://github.com/terryyin, thank you for the tool, very cool and useful!

I have a small remark though: with the last release, the tool became considerably slower. As a test, I called lizard.analyze_file.analyze_source_code() on 3910 files, and these are the statistics:

lizard v1.15.7

Analyzed 3910 files in 0:2:25

lizard v1.16.1

Analyzed 3910 files in 0:24:40 As you can see, we moved from 2 minutes to 24 😕

Not an urgent problem, I am gonna stick with Lizard==1.15.7, but just to let you know 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/253, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwJYsEklyP5cduMqbvHZSRh7MjhPcSRks5vMVjbgaJpZM4a0BkX.

ishepard commented 5 years ago

Mmm nope the problem seems to be still there.

ishepard commented 5 years ago

As an example, I downloaded this file: https://raw.githubusercontent.com/google/jsonnet/master/cmd/jsonnet.cpp

and then:

# Lizard 1.16.2
> time lizard jsonnet.cpp
.....
lizard jsonnet.cpp  8.62s user 0.02s system 99% cpu 8.659 total
# Lizard 1.15.7
> time lizard jsonnet.cpp
...
lizard jsonnet.cpp  0.08s user 0.01s system 96% cpu 0.097 total

As you can see, 8 seconds instead of 0.08

terryyin commented 5 years ago

OK. Got the culprit (from a pull request), which is a piece of low performance Regex. Fixed.

ishepard commented 5 years ago

Yes I can confirm it, the problem has been fixed! Thank you for your fast replies 😄

terryyin commented 5 years ago

Thanks again for reporting this.