I'm wondering if Chrysalis is perhaps onto something here, I vaguely remember a long long time ago that my scheduled graphs took a long time to be created, and I'm sure is was around the GDATA bit that the delay was happening. Unfortunately I can't remember when it was, but I did email BE1 about it, but I can't find the relevant email either. It was certainly prior to me splitting my modem log into separate years and also certainly when the server was using a spinning HDD for the OS and Modem Stats. I think the only reason I noticed was that HG612_Stats was having problems running as one instance was waiting for the graphs to be plotted when another started, and I think the programs were altered so HG612_Stats could close, and the graphing could get on and do it's thing.
Unfortunately due to using a text file for the stats there's not very much that could be done to speed things up, and I think what BE1 has come up with is probably one of the best solutions that I'm aware of - remember that neither of us are programmers via profession and have had to learn to code to write our respective programs.
Regarding defragging the file, this is very simple, no additional programs are required, I'm pretty sure that making a copy of the original, then deleting the original and renaming the copy would have the desired affect. But we don't want to be doing this on systems running on SSD's