[Tutor] suggestion for an editor

Wayne Werner wayne at waynewerner.com
Fri Jul 20 15:07:28 CEST 2012



On Fri, 20 Jul 2012, Steven D'Aprano wrote:

> Bala subramanian wrote:
>> Friends,
>> At present i write programs using vi editor. I am interested to change to
>> something else. My specific need is that i want to select a portion/small
>> segment of my program (for eg. a nested loop) and then monitor processing
>> time it takes for that portion while i run the program. By this i hope to
>> find the segment that takes time and modify to achieve better speed. Can
>> someone please share their experience.
>
> I don't think that what you want exists. As far as I know, even full-featured 
> IDEs (Integrated Development Environments) don't include profiling of 
> selected sections of code.

It *would* be possible with a programmers editor (like Vim/Emacs) to write 
a macro or some type of extension to mark a block of code and have it 
profiled for you. But this would most likely consist of taking the exising 
code, finding the place where it's called in your application, and 
replacing that with a call through timeit, executing the app, and then 
removing the code (or do that in a temp file).

But you could also write a fairly simple Python script to do that for you, 
without any type of IDE integration.

-Wayne


More information about the Tutor mailing list