n Fri, Jul 29, 2011 at 12:20 PM, Noufal Ibrahim <nou...@gmail.com> wrote:
> I agree and I try my best to do the same thing. However, I differentiate > between micro optimsations like rewriting parts in C and XML and top > level optimisations like good design and the right data structures. > > Using regexp is micro optimization? > The former, I don't do because I get bogged down by the details and end > up delivering something that's super fast *really* late. The latter, I > do because otherwise, the application is unusable and a bad > experience. Also, micro optimising (e.g. replacing DOM parsing with > regexps to extract stuff out of an XML message) makes code more brittle > which is also a no win for the customer. > IMHO, regexps are much more powerful and fault tolerant than XML parsing. XMLs are brittle. > If performance is *this* important to you, why don't you code your > entire application in assembly hand crafting it for a certain processor, > amount of memory and hard disk platter speed? Why use Python at all? The > reason is because Python is "fast enough" for most things. You can get > better performance moving to lower level routines but it's often not > necessary and the costs it entails are usually not worth it. Better a > fast enough stable app than a super fast one that occasionally segfaults > and loses data. > Not sure how this point is relevant; the amount of performance you need is dependant on the nature of application you develop. For eg, see this presentation for how simple hacks like 'compressing' dom 'getters/setters' can affect browser performance. http://paulirish.com/2011/dom-html5-css3-performance/ At the same time, look at this TED talk wherein trading applications spend billions of $ for milliseconds performance gains http://www.youtube.com/watch?v=TDaFwnOiKVE For a webapp, XML parsing is very important factor that the developer *must* consider while designing. _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers