Hacker Newsnew | past | comments | ask | show | jobs | submit | drfugly's commentslogin

Because then you have to control ALL of the memory, not just the data that you're interested in optimizing. Not to mention that (at least in the JVM) the gc is pretty tweakable, and the entire team may not need to know about all of the tweaks.


This is precisely how it looks from this "microallocating" perspective.


As a netbeans user but vim fanatic. I really like netbeans for project management, but vim is awesome for just manipulating text tons faster than you can with netbeans. Try the jVi plugin for netbeans to get that text editing power of vim with the project management features of netbeans.


In my line of duty, most of the time spent in reading code, not writing code.

Even when we were building version 1.0 of the software, there aren't too many text editing as opposed to navigating the code tree.

Isn't dynamic/scripting languages like Ruby and Python produced way less code than Java? (Hence, less typing again).

So this is why I don't quite get the group of people that swear by vim.


Will do for the color scheme.

What I was trying to ask was: Should real world performance be more heavily weighed? I feel like right now all the CS curriculum focuses on is O() performance as the end all.


Normally, my (favorite) CS professor would weigh code clarity more strongly than performance. However, he would sometimes put up assignments that focused almost entirely on the performance, in which he obviously changed the grading weights.


When you were in class, where you ever even introduced to the concept that sometimes it might be possible that O() notation might not tell the whole truth? I understand that for the most part you shouldn't have to worry about it, but shouldn't we still warn students about this?


We were taught what big O notation actually is, so yes. The whole point of big O notation, what makes it so useful, is that it hides information (namely constant factors). It's not supposed to "tell the whole truth," it's supposed to allow the analysis of algorithms not at any one runtime, but in an asymptotic mindset.

With big O notation, you're not interested in how fast an algorithm ever actually runs (for that is the realm of constant factors), but rather how its running time changes as the size of its input changes.


Absolutely! I suppose when I speak of asymptotic analysis, I'm including average case/expected case/degenerate case analysis in the whole exercise. Perhaps "runtime analysis" is a better term - it can then incorporate latency analysis as well.

But yes, that was integal to the treatment of the subject. I remember having to determine what the worst-case of quicksort looks like as a part of an assignment to exhibit, in practice, best/average/worst case runtime of a number of sorts - and this was an freshman-level intro course. That particular problem was one of the most fun homeworks I've ever had - a rather satisfying solution.


We talked about these things as well. I remember studying how to calculate the percentage of data sets of a given size that would bring out the worst-case running time of quick-sort.

Really, I think the issue with all the criticisms of asymptotic analysis is simply that too many people (even brilliant programmers and CS majors) just don't understand what big O notation actually means. If an algorithm is in, say, O(n lg n), that says nothing about how fast it runs with 10 inputs, 1,000 inputs, 1,000,000,000, etc. It merely says how its running time changes as its input size increases. The algorithm could literally take 1,000 years with an input size of 10. That doesn't matter. At some input size, it will run faster than a different algorithm in O(n^2) that completes in 1 millisecond with an input size of 10.


The algorithm could literally take 1,000 years with an input size of 10. That doesn't matter. At some input size, it will run faster than a different algorithm in O(n^2) that completes in 1 millisecond with an input size of 10.

𝜪 is an indicator of work (number of steps) for a given n, not wall-clock time. This gets mildly confusing when you give each unit of work a value of 1 unit of time, and then talk about it in terms of time-like labels (seconds, hours, age of the universe).

I don't see that there's value is comparing an algorithm of n = "some input size" to another one with a different 𝜪 of n = 10. When comparing, you don't care about the value of n, you only care about how n changes the amount of work. When actually selecting and implementing, you care about n (because n will often be limited by something else, say available memory) -- if your n is small and pragmatically you know that even a terrible, brute-force algorithm will finish in a second, you use the one that is easier to implement and put an implementation specific limit on n (and you also put a TODO or FIXME on it with a comment that says if n ever needs to be increased, a different algorithm should be used).


Do you mean something like the case of quicksort mentioned in the post?[1] I was taught average- and best-case analysis along with worst-case analysis. Or do you mean some other fact not revealed by that analysis?

[1] "Quicksort is a magical algorithm that theory tells us runs in O(n^2)"


Right, but there is also the cases where a nlg(n) quicksort for the most part is slower than the O(n^2) version in the real world. I wonder if current CS teaching is completely ignoring real-word performance.


Could you explain what you mean a bit more by big O notation not telling the whole truth? Are you referring to the fact that algorithms that look the same in big O notation might have drastically different constants, which can affect real-world performance?


It can be worse. A O(n log n) algorithm might be slower than a O(n^2) algorithm for all practical values of n.

Also, one should be careful what to count. Sorting strings, for example, is not quite O(n log n); average string length/expected offset of first difference/whatever should also be in that O().

Along the same line, for many algorithms, cache-locality is more important than number of CPU cycles. So, counting cache misses rather tha cycles can be the better way to judge an algorithm.


Yes, that's exactly what I'm getting at. Or cases where multithreading an application may look like it's going to bring obvious performance gain only to see the overhead kill your performance.


Yes, a few professors discussed situations in which a theoretically slower algorithm was better in almost all real situations, and situations like timsort in which it is best to fall back on an asymptotically slow algorithm when your inputs are very small.


Isn't there xmove for this kind of stuff?


At that early age I wonder how much CS specific training is going to be given. Also with IBM's current focus on not just being a tech company anymore I would dream that the education is a bit diversified.

Maybe having a specific goal to drive for will make it easier students and teachers to focus on a certain goal but I don't think that it'll make the students less able to switch tracks if needed.


Netbeans with the jVi plugin for my vim bindings is where it's at for me.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: