Python’s cProfile–Profiling your code straight-a-way!

This past day or so I have been working on some Facebook puzzles, and in doing so I’ve used Python’s built in code profiler cProfile. It is incredibly easy to set up for cases such as these: simply import cprofile, and then call your entry point with: cProfile.run(‘Main()’) replacing Main with the name of your entry point. You get CPU timing results, for instance showing that calling a C function to compete the Levenshtein Distance will reduce the time for computation to completion by more than half! Good profiling data and a powerful user friendly debugger are two of the most important software QA tools available.

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *