On Sun, Aug 19, 2012 at 8:53 AM, Charles Hixson <[email protected]> wrote: > FWIW, I would prefer to be using a faster language, but I also prefer a > language that's rapid to develop in. And "premature optimization" is a > problem that is endemic to programmers that are concerned about execution > speed.
+2 > Quite often what you really need is a better algorithm. (But it > sure is nice to be able to tell is some choice is going to really slow > things down. But that statement often needs to be taken with a large grain of salt since often you cannot make a general statement about performance of a particular piece of code which always applies without the context. Measuring is the most reliable and fastest way to know. > I will often write special case pattern processors rather than > using regular expressions because of this. What patterns did you process? Can you give more detail? I am curios because usually regular expressions are faster. > It may not be true any longer, > but at one point I timed one of my problems, and special case code in ruby > was considerably more than 50 times faster than using a regular expression. > That was years ago, and as I said it may not be true any longer. But I tend > to presume that it's still true, and the only way to really be sure is to > run exhaustive timing tests after every library or compiler change. You are comparing apples with oranges here: MRI has changed dramatically from 1.8 to 1.9 and so did the regexp engine. I may be the regexp engine internals which make a difference now or a badly crafted regexp. Without knowing more about your code your statement is basically meaningless to us. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/ruby-talk-google?hl=en
