[BangPypers] regarding profiling

Sriram Karra karra.etc at gmail.com
Wed Oct 17 19:21:58 CEST 2012


On Wed, Oct 17, 2012 at 7:42 PM, Basil Kurian <basilkurian at gmail.com> wrote:

> Hi
>
> I 'm trying out some python puzzles in interviewstreet.com. Most of the
> time , when I submit my code , during testing process , it will get timed
> out since the execution is taking too much time (for big input values).
>
> I tried profiling the program execution using cprofile. Still can't
> find any operations that is taking too much time.
>

I did not try too hard, but reading your code I can't figure out what it's
trying to achieve. I have two suggestions:

1. You obviously have a nested loop 3 levels deep, which has to be your
number 1 suspect. Perhaps it is not required to solve the problem, and a
different approach is called for. Describe the problem statement in brief
and someone may be able to shed some light.

2. Write a small script to generate very large input test files so you can
get more meaningful profile information from cprofile.
-Karra


More information about the BangPypers mailing list