If I have a large html page I retrieve from a database, and it has multiple small PHP tags within it that need to be eval()ed. Is it better performance wise to just eval() the whole page, or to break it up and eval() just the small snippets individually?
Share
You’ll spend more time processing/splitting than you would with the single eval(). PHP’s already quite efficient at loading/parsing/executing code from a file, so let it do what it’s good at, rather than second guessing the system and adding extra unnecessary overhead.
Of course, if you’re really gung-ho for it, you can try both methods and do some benchmarking.