A lot of small steps are required. Delphi 2009’s method of connecting to the help file has changed, and I had to find out how to get that going. Some of my internal string constants had to be changed to Unicode, and it took awhile to track that down. The timing routine I included previously no longer works. There are other things I’ve already found and now got working.
But the major item I finished today has now got Behold semi-working again. Previously I loaded the GEDCOM file into a string buffer, and picked out the statements character by character. Under Delphi 2009 that simply failed. Now I directly load the file into a StringList in memory that already has each line as an individual item. Not only is that simpler, but Delphi 2009 is smart and converts non-Unicode into Unicode while doing it. Initial results seem to be that it is maybe a bit faster than it was before.
But there’s all sort of things you don’t expect that you accidentally stumble upon. While searching the web for an efficient way to load the GEDCOM file, I ran across a post by Jolyon Smith about String Performance. He said that the new “String Format Checking” compiler option which is turned on by default should be turned off since it incurs a performance penalty. Searching a bit more, I found this great article by Jan Goyvaerts explaining exactly why this is so. This compiler option is actually undocumented in Delphi 2009. I’m not sure how much of a difference this will make for Behold, and I can’t tell for sure until I get a profiler and do some testing. But when I’m trying to get every speed advantage that I can, these sorts of tidbits can really add up to performance improvements.
After only 8 days since I began the conversion, Behold now runs in Delphi 2009. But there’s still a number of bits and pieces, special cases, and user interface issues to clean up before this step is done.