Performance -- Eval vs Include

This is a discussion on Performance -- Eval vs Include within the PHP Language forums, part of the PHP Programming Forums category; For those of you that have tested eval() vs. including a file many times, I'd appreciate your comments on ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2005
*/hack/*
 
Posts: n/a
Default Performance -- Eval vs Include

For those of you that have tested eval() vs. including a file many times,
I'd appreciate your comments on which one is better for performance.
My application will have a queue like routine in which I may have to include
a file many time. The file will contain a series of switch/case statements.
Depending on specified criteria, this file will need to be processed from
one time up to X times. I am not really worried about the usual case where
the file will be included less than 3-5 times in one request, however, above
that I have to wonder where to save on performance.

Those of you writing parsers are probably moreso in the know on this one,
however, anyone else that has a clue please feel free to add your 2c.

Thanks,

-Laidbak


Reply With Quote
  #2 (permalink)  
Old 02-19-2005
noSpam
 
Posts: n/a
Default Re: Performance -- Eval vs Include

*/hack/* wrote:
> For those of you that have tested eval() vs. including a file many times,
> I'd appreciate your comments on which one is better for performance.
> My application will have a queue like routine in which I may have to include
> a file many time. The file will contain a series of switch/case statements.
> Depending on specified criteria, this file will need to be processed from
> one time up to X times. I am not really worried about the usual case where
> the file will be included less than 3-5 times in one request, however, above
> that I have to wonder where to save on performance.
>
> Those of you writing parsers are probably moreso in the know on this one,
> however, anyone else that has a clue please feel free to add your 2c.
>
> Thanks,
>
> -Laidbak
>
>

file operations are expensive - keep them to a minimum, mind you so is
eval. Sounds like a design problem
Reply With Quote
  #3 (permalink)  
Old 02-20-2005
Michael Fesser
 
Posts: n/a
Default Re: Performance -- Eval vs Include

.oO(*/hack/*)

>For those of you that have tested eval() vs. including a file many times,
>I'd appreciate your comments on which one is better for performance.


I try to avoid eval() whenever possible. Sometimes it may look like the
most simple solution, but in most cases there's a much better and faster
way to do something.

>My application will have a queue like routine in which I may have to include
>a file many time.


The same file? Sounds bad. Including a file _one_ time is more than
enough. Consider to use functions.

Micha
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:01 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0