5 ms·
I think a more relevant portion of what Joel what talking about is the 'full stack'/'ductape' programmer. The number of times I've seen people optimizing their
by fleitz 16y ago
I think a more relevant portion of what Joel what talking about is the 'full stack'/'ductape' programmer. The number of times I've seen people optimizing their for loops instead of their DB queries or their caching mechanisms in a web app is simply astounding. Few people realize that there is far more 'slow' code in the parts they didn't write than the parts they did write.
Think about it, in the 'full stack' of browser -> client -> interweb -> web server -> app server -> db server the little bit of code that you wrote is minuscule compared to what you didn't write. Tune up your TCP stack, tune your webserver, add cache headers, add indexes, etc. Most apps can drastically increase their performance with out even changing a single line of code. And when you're tuning up your code, look for single lines of code to change.
Definite protip in there on debugging with wireshark.
We had a client once that we could only login to their IMAP server but not download mail. A little bit of digging with wireshark and we figured out that he had some old POS router that couldn't handle window scaling. Solution? Turn off window scaling on one of the servers.
- silentbicycle 16y agoAgain, the assumption that everybody is a web programmer. No wonder people approach the command line with obsequious awe!
- perlgeek 16y agoFor the non-web (and sometimes even for the web) programmer, strace can be a real life saver. An application complains about not being able to find a file, but doesn't report where it looked for it? strace can tell. Do you want to know why a system call failed, and the app is too crappy to report the error? strace to the rescue! Of course, if you're lucky you might even have access to dtrace...
- mkjones 16y agoThis mostly-web programmer finds strace and (more often) ngrep (http://linux.die.net/man/8/ngrep http://linux.die.net/man/8/ngrep) to be some of the most useful tools out there for debugging errors both strange and mundane.
- crux_ 16y agoMy favorite strace story: trying to get at the underlying causes of some "Unexpected Error" messages in ArcGIS, and it turns out it's writing helpful and useful (albeit two decades old) logging + error messages to the Windows equivalent of /dev/null. shakes fist @ ESRI HQ once again
- khafra 16y agoFor me as a user, strace can be a real life saver. I'm not hep enough to the jive to read the source code and figure out what [incredibly uninformative error message regarding file access] means, but I can read strace output and see what file the executable is trying to access, and what it's trying to do to it.
- fleitz 16y agoYes most definitely, strace / truss have been absolute life savers. And if you are looking for something similar on Windows Process Monitor is excellent. You can also do a lot of DTrace style stuff with WMI and VBScript.
- GFischer 16y agoThe Windows equivalents would be the Sysinternal tools, I guess (Filemon, Procmon, etc..). http://technet.microsoft.com/en-us/sysinternals http://technet.microsoft.com/en-us/sysinternals
- stcredzero 16y agoA cute goth daughter of a friend once squealed with delight when she saw another friend of mine (a NASA hacker) type 'monkey' into Terminal.app and cause some remote login magic to happen. Oh, the arcane magic of "alias." Then again, there have been times I've seen young people impressed by what amounts to "Row, your boat" played on an actual mandolin.
- steveklabnik 16y agoTo be fair, many of us web programmers use the command line extensively. 75% of what I do is web work, and It's all written in vim, and often ssh-d into a server. I got my irssi running in a tmux session 24/7... Web programming has much more in line with systems work than most appreciate.
- squeed 16y ago"""Think about it, in the 'full stack' of browser -> client -> interweb -> web server -> app server -> db server the little bit of code that you wrote is minuscule compared to what you didn't write.""" This. The old saying "don't prematurely optimize" has never been truer. Too bad it's gotten harder to profile. Unless you write a boring CGI, one-load-per-page site, you're never going to be able to get all of that information server-side. The only way is with browser-based testing frameworks... Sigh.
- fleitz 16y agoAnd even at that you'll need a network nightmare box or equivalent to simulate all the high latency connections out there.
- rhizome 16y agoWith Dummynet, FreeBSD can simulate any kind of connection you can think of. Latency, packetloss, the whole schmear, available in bootable ISO form. http://info.iet.unipi.it/~luigi/dummynet/ http://info.iet.unipi.it/~luigi/dummynet/
- shaddi 16y agoI've used Dummynet extensively (with great satisfaction!), but I've been looking for a more recently updated alternative (preferably with good Linux support). Is anyone aware of any such thing?
- cperciva 16y agoThe most recent commit to the dummynet source code was 5 days ago. Are you sure you need a more recently updated alternative?
- Sukotto 16y agoWhere do you see that? On the page linked in the GP the most recent revision is dated 2010-03-19 Do I just not see the link to the repo or is there another project page someplace?