I've created a file download system in (somewhat) OOP. It's just short of a thousand lines so I've stripped everything away but the part I feel is the slowest (I actually did profiling, even though it's not needed because it's clearly slow)
What I want critique on is if there's a better(read faster) way to do it, I've already tried to optimize it as much as possible but it's still running slow on my local comp. (a real server is faster of course)
Here goes: http://pastebin.dk/index.php?show=2027
I included everything relevant, supporting resuming etc, but the timekiller is the actual fread statement, I did it this way to avoid the overhead of calling a var or a function to check if the file was done being read and it helped a lot.