Thank you @Fou-Lu
I'm not using the JS itself, I'm outputting the text content (of the JS file) using Google's Prettify.
Actually, 1000 lines isn't that long. I suspect it's the prettify-ing that's slowing it down. I should try and create a simple timer..
Perhaps I could read the file length and get the contents and prettify it in two or three stages, still using get_file_contents. Maybe I could read just 1/10th of the file first and prettify it, so at least there's some content displaying whilst the rest is being
parsed.
But I'm open to suggestions