From: "Glenn M. Lewis" Date: 2005-09-11T05:41:31+09:00 Subject: Re: Optimizing a single slow method Hi Robert! Yes... I found out that if I create a hash of contract names that I've already decided to ignore, then I can immediately test field[0] to see if I can totally ignore the line, like you had suggested. Oh, sorry... the only thing I was referring to was not being able to speed up the File I/O and parsing in another language... and I only said that because I had just finished another Ruby project where the original file parsing of about 80Megs of data would take over 10 minutes, and when I rewrote the File I/O and parsing in C++, I could do all of it in less than a second. But that is neither here nor there because the other optimizations recommended brought down the load time to 26 seconds, which is now acceptable and no longer worth the pain to create a C++ module that will communicate with Ruby in both directions. No, I never tried the DateParse... as Eric recommended that I no longer use Date, but switch over to Time... he was right... I got a significant speedup with switching to the Time class. Thanks for your help! -- Glenn Robert Klemme wrote: > So you changed Contract.open()? > > I don't know the condition for having Contract.open() return nil (or > false) but if it's a certain pattern of field[0] that might be caught by > the regexp approach I suggested. > > Btw, which part of my posting did you object to? Did you try DateParse > at all? > > Kind regards > > robert