Closed mdmedley closed 8 years ago
@rakhimov @terryyin I modified my pull request to remove the duplicate call which prevents the need to exhaust the generator just recreate it, thus speeding up the application in the cases where there are warnings.
I also seem to have broken the build. @terryyin or @rakhimov if either of you know exactly where to fix this it would greatly reduce the time it's going to take me to figure it out.
Testing on Linux kernel code (quad-core i7 laptop):
lizard -t 6 -Ecpre -a 6 -l cpp > complexity.txt
current master branch:
real 4m12.183s
user 25m3.672s
sys 0m5.340s
Not bad for 12 million lines of code with 21,116 warnings. The output file weighs 48M.
with @mdmedley patch
real 4m9.342s
user 24m45.100s
sys 0m7.672s
There seems to be some speedup, maybe? P.S. It is frying my laptop: 80-86 *C :-)
The same benchmark as before with pypy:
> time pypy ~/projects/lizard/lizard.py -t 6 -Ecpre -a 6 -l cpp > complexity-pypy.txt
real 1m30.777s
user 9m0.064s
sys 0m7.012s
Almost 3x speedup. Moreover, it doesn't fry my laptop: 67-70 *C.
As you can notice from the timings, multi-threading is scaling pretty well.
Test test_exit_with_non_zero_when_more_warning_than_ignored_number
is passing on my local branch...
nosetests test
...............................................................................................................SS................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 497 tests in 0.376s
OK (SKIP=2)
But I do see that I only have 497 tests while the Travis output has 501 tests.
tests are passing. the problem is that for-else wart.
@rakhimov what do you mean by that I don't understand
There's a good old idiom in C++ to do what for-else
is trying to address: http://llvm.org/docs/CodingStandards.html#turn-predicate-loops-into-predicate-functions
Thanks for the work and extra clean up:-)
The very first time I ran the analyzer I was confused because I saw this big "!!!! Warnings" section with nothing under it. So I removed it. Then I realized that knowing what the thresholds were in your execution is important so I wrote a new print method to give the user that information is a less alarming message. Plus a couple other minor changes to the README.rst and the setup.py files.
Example Output