h a l f b a k e r yLoading tagline ....
add, search, annotate, link, view, overview, recent, by name, best, random
news, help, about, links, report a problem
browse anonymously,
or get an account
and write.
register,
|
|
|
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]
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]
[link]
|
| |
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. |
|
| |
How well could it estimate the runtime for something like a heavily embedded set of conditional method calls? Imagine a recursive search technique that breaks out of a loop if it becomes stuck - the time complexity is going to be heavily dependent on how far it gets into each loop and how deep into the recursion rather than the complexity of the actual methods employed. |
|
| |
There's also all sorts of issues regarding code reachability and the impact of that code on the running time of other sections. |
|
| |
I'm not saying it's not possible and I'm not saying it's a bad idea - I'd love something that could indicate up front if I'm likely to lock my machine up for a day if I run *that* code. |
|
| |
As bigsleep on the code complexity versus runtime front. |
|
| |
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. |
|
| |
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 |
|
| |