in reply to How does the while works in case of Filehandle when reading a gigantic file in Perl
The time used up is likely depend on your {do something} - the while loop itself resumes reading from your file at the very spot the previous read has stopped, up until an EOF is encountered.
I therefore suspect that the loop's body somehow causes things to bog down - but in order to shed more light on the issue, I would have to know exactly what's going on in {do something}...