Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Any performance difference between these 2 codes?


m5n6

Recommended Posts

code1:

 

<?php

define(...);// line 1

define(...);// line 2

define(...);// line 3

define(...);// line 4

?>

 

code2:

 

<?php

define(...);// line 1

define(...);// line 2

?>

 

<?php

define(...);// line 3

define(...);// line 4

?>

 

I'm guessing the performance difference can be ignored.

 

Thanks for any comments

Link to comment
Share on other sites

You mean there is 'other stuff' between the defines in example 2?

No, there is no significant difference AFAIK.

The define gets defined in the same speed.

Opening a few <?php ?> tags more or less should not be a time issue.

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

The real question is why you would want to define variables throughout your code? I'd hate to pick up a coding project that you began!

 

Opening and closing php tags a couple of times would not impact performance. However, if you want to get down to clock cycles... snipet 2 is slower than 1.

Link to comment
Share on other sites

Ryan, thanks for your reply!

 

The reason is that I'm using 2 contributions and I want to add them automaticly. this way I can easily upgrade without a lot of file merging.

appending 1 file to the end seems better than search "?>", since it might be more than 1 of them.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...