Menu

Speeding up the MISRA checker

2019-02-06
2019-02-07
  • Richard Smith

    Richard Smith - 2019-02-06

    On our codebased the MISRA checker takes a long time to run (minutes).

    I've done some initial profiling. Seems the token and string matching really eat up resources. Looking at this profile I'm also suspect that there may be some sort of issue with how things are setup. The code base only has 67kloc yet simpleMatch is called almost 37 million times? Seems excessive.

       ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     36951737   49.499    0.000   55.322    0.000 misra.py:43(simpleMatch)
           226429   15.701    0.000   15.734    0.000 misra.py:367(findRawLink)
                    101   11.032    0.109   42.332    0.419 misra.py:1379(misra_16_3)
     78950847    8.312    0.000    8.312    0.000 {method 'startswith' of 'str' objects}
    
     
  • Daniel Marjamäki

    Thanks! I did not worry much about performance when I wrote the addon. If you want to speed it up feel free to do it.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.