HDFilmMaker2112 Posted November 13, 2011 Share Posted November 13, 2011 Just looking for an opinion on which one of these two pieces of code would process faster: <tr align="center" class="border"> <td class="border">'; if($copper=="yes"){ $content.= '<span class="strike">Copper</span>'; } else{ $content.= 'Copper'; } $content.=' </td> <td class="border"> '; if($copper=="yes"){ $content.= '<span class="strike">$10 - $35</span>'; } else{ $content.= ' $10 - $35'; } $content.=' </td> <td class="border">'; if($copper=="yes"){ $content.= '<span class="strike">800</span>'; } else{ $content.= ' 800'; } $content.=' </td> <td class="border">'; if($copper=="yes"){ $content.='Levels that are crossed out are full.'; } else{ $content.='Name in end Credits + Nickel Level'; } $content.=' </td> </tr> vs. if($copper=="yes"){ <tr align="center" class="border"> <td class="border"> <span class="strike">Copper</span> </td> <td class="border"> <span class="strike">$10 - $35</span> </td> <td class="border"> <span class="strike">800</span> </td> <td class="border"> Levels that are crossed out are full. </td> </tr> } else{ <tr align="center" class="border"> <td class="border"> Copper </td> <td class="border"> $10 - $35 </td> <td class="border"> 800 </td> <td class="border"> Name in end Credits + Nickel Level </td> </tr> } Quote Link to comment https://forums.phpfreaks.com/topic/251081-efficiency/ Share on other sites More sharing options...
KevinM1 Posted November 13, 2011 Share Posted November 13, 2011 Negligible difference between the two. Such micro-optimization is usually a waste of time. Focus on the real bottlenecks (read: database), and cache when you can. Look into memcache and APC for examples. Quote Link to comment https://forums.phpfreaks.com/topic/251081-efficiency/#findComment-1287895 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.