View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sum01 Final Exam Review: Optimization Strategies

1)What's going on here is premature optimization. Programmer is not taking the advantage of language
features and doing too much work writing in primitives. Its better to first write the program and then
optimize where needed.

2)Possibly wrong optimization. Here it depends on what is in the movie sequence, but it will be
better to try to optimize the algorithm which displays the objects then trying to change the data
structure completely.

3) Premature Optimization? Trying to code something which will take a lot of time, without looking
at whats already available in squeak.





On (2), why focus on the display of objects? Most of that is already done in primitives. Also, in a big movie, figuring out what item to display next can very well take a long time.

(3) is half right and half wrong. -Lex Spoon





3. Should look at other availiable data structures (Collections) instead of being tied down to binary tree?

qwerty

(3) A valid consideration, but what's the BIG problem here? Suppose our strawman has done a careful mathematical analysis to show that binary trees are a very good choice. What is wrong, nevertheless? This can be hard to see because professors do it in classrooms so often. Suppose it's not a classroom.... -Lex Spoon


Uh, don't know, more hints????
(2) This is treating the symptom, not the problem. Find out why the movie player is running too slowly. If you just go off trying to fix something before you know in which way it is broken you are probably wasting your time.


3) I don't know. Can you tell us anything else, or point us in
the right direction? I'm not going to figure it out.

- david raines



(3) I could only think of this as the problem– he's thinking too much about one specific part of his program instead of starting at the design phase? ... so what's the answer Lex? -axiom



(3) the big problem to me is that you don't always have a week to do something, it is always a trade off between time and performance, and you rarely have time in (or so it seems to me) to do the "best" solution.
(3) the big problem to me is that you don't always have a week to do something, it is always a trade off between time and performance, and you rarely have time in (or so it seems to me) to do the "best" solution. -Russell



3. What if something needs to be changed in the future? putting a weeks worth of effort into a vey complex structure makes it hard to maintain and creates a lot of overhead if anything ever needs to be changed. - project.c


3) I think we're forgetting the "half right" part of the first answer. A balanced binary tree is a pretty common data structure - there's sure to be an implementation already out there, already coded and optimized better than John Q. Programmer can do in a limited time frame. - TM

Good point. Still, the biggest problem is that a really simple OrderedCollection may well be fast enough. Who knows? You won't, until it's actually tried. In fact, consider the example. There are actually less than 100 Squeak packages out there in the world, and so you can probably do linear searchers through the entire "database" in less than 10 milliseconds. This is probably fast enough, even though it's much slower than what is possible. But I don't know for sure, either. You have to try it!

This is "premature optimization" in a very pure form – it's literally optimization being done too far in advance. -Lex Spoon






Link to this Page