Half a croissant, on a plate, with a sign in front of it saying '50c'
h a l f b a k e r y
Like gliding backwards through porridge.

idea: add, search, annotate, link, view, overview, recent, by name, random

meta: news, help, about, links, report a problem

account: browse anonymously, or get an account and write.



Cost Highlighting Editor

Highlight functions based on complexity instead of syntax
  [vote for,

There are a lot of syntax highlighting editors/IDEs out there. What if we were to create an editor/IDE that would analyze the source code, and highlight stuff based on estimated best/average/worst case runtimes.

For example, something like:

print 'hi'

would be black, but

def bubblesort(inputList): ...

would be red, with other stuff being in between. The editor would use a database of known built-in functions (specific to the language) and idioms with some other heuristics thrown in.

[As a bonus, the editor could offer complexity-based refactoring hints]

cowtamer, Mar 23 2007

Alan Turing's Halting Problem http://en.wikipedia...iki/Halting_problem
Good luck. [zen_tom, Mar 23 2007]

Busy Beaver Functions http://en.wikipedia.org/wiki/Busy_beaver
Not sure how you'd be able to spot these type of things. [zen_tom, Mar 23 2007]

Please log in.
If you're not logged in, you can see what this page looks like, but you will not be able to add anything.


       It should have several modes so you can see a summary plus highlighted code for several criteria. That way, you can write your code, enter "runtime mode", and see at a glance your bottle necks. Next, enter "maintainability mode", so on so forth.   

       This would discourage premature optimisation, as you could concentrate on getting the thing to work first and know you'll have a guide for optimisation later when you've forgotten how everything fits together.
TheLightsAreOnBut, Mar 23 2007

       It would also depend on the architecture of the target machine - I've worked on machines where FFTs were trivial, but string searches nigh-on impossible.
AbsintheWithoutLeave, Mar 23 2007

       This is meant to be more of a complement to a syntax or maintainability highlighting editor, which is fully baked (Eclipse, WingIDE, etc.).   

       To add context: We recently found a bubble-sort routine implemented in somewhat convoluted python embedded in our (not well documented) code. Something like this would have at least given the author an idea that they were doing something slow and unnecessary (python has built-in sorting). Clearly it won't catch everything, and won't be right about everything
cowtamer, Mar 27 2007


back: main index

business  computer  culture  fashion  food  halfbakery  home  other  product  public  science  sport  vehicle