473,516 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 17 '05 #1
2 4300
*/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
Jul 17 '05 #2
.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
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8026
by: Simon | last post by:
Am using the following code. <script language="JavaScript1.2"> function setquantity(productindex,productquantity) { //create the reference object irefname_none = eval("document." + productindex + "none"); <snip>
115
7475
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical transform function. When compiling under gcc on my big-endian PowerPC (Mac OS X), declaring this array as "static" DECREASES the transform throughput by...
0
2488
by: Don Pedro | last post by:
According to the documentation for the DataBinder class's Eval method should it only be used with discretion due to the fact it is latebound and uses reflection. "CAUTION Since this method performs late-bound evaluation, using reflection, at runtime, it can cause performance to noticeably slow compared to standard ASP.NET data-binding...
1
1197
by: meir | last post by:
i have 2 general questions about performance: 1. i heard that using <%# databinder.eval(....)%> will effect the performance and i wanted to know it that's corrent. 2. also about performance - does is matter if we use codebehind or writing <script> tags in the aspx page? or once compiling the solution, all the server side data (wherever it...
1
1138
by: DBLWizard | last post by:
Howdy All, I was reading an older posting about the performance hit of DataBinder.Eval. http://groups-beta.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_frm/thread/5d3c727cac4537fc/a02b1685ae0f63c0?q=DataBinder.Eval(Container&rnum=4&hl=en#a02b1685ae0f63c0 Am I correct in understanding that <%#...
13
2085
by: Stephen Kay | last post by:
Is there a way to redirect every single page on an existing web site through a php function? In other words, say I have a whole functional HTML web site, never written to use any php. Now I would like to have a php function handle displaying every page, for example, instead of: http://www.mysite.com/mypage.html you would call:
4
3369
by: Jon Slaughter | last post by:
I'm using eval to excute some mixed php and html code but I cannot debug it. I am essentially using filegetcontents to load up a php/html file and then inserting it into another php/html file and then using eval to execute the final product. If I were to use include and output buffering instead of filegetcontents would it allow be to...
0
1473
by: Shades799 | last post by:
Hi All, I was wondering if any of you could help me with a very difficult problem that I am having. I have an ASP site that works with an Oracle database using an ADODB connection. This connection is stored in a .dll file. This site had been working fine. However recently we upgraded our Oracle database from 9i to 10g and ever since then...
1
2667
by: bizt | last post by:
Hi, Im currently looking to move into using JSON for AJAX instead of returning from the server a string like the following: 12345{This is a text string{true I prefer objects because I dont need to specifiy the index key and I can treat it exactly like an array - oSet = ... Are objects just as quick to access/alter as arrays? I have a...
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7581
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.