Hi Oscar,<br><br>I'm already working on an opensource framework, when I finish it's architectures I will send it to you, to see how I deal with performance issue.<br><br>Cheers,<br> Ahmad<br><br><div class="gmail_quote">
On Nov 9, 2007 4:51 PM, Oscar Renalias <<a href="mailto:oscar@renalias.net">oscar@renalias.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Nov 9, 2007 3:00 PM, Ahmad Saleh <<a href="mailto:ahmadfds@gmail.com">ahmadfds@gmail.com</a>> wrote:<br>> Hi guys,<br>><br>> LifeType really is a great service, however, it's very slow, I like Lifetype
<br>> and really I wish the best for it and for you guys.<br><br></div>We do what we can, but have you considered scaling your hardware up?<br>It sometimes helps. PHP, Apache and MySQL are quite good at scaling<br>upwards (more powerful servers) and horizontally (more servers)
<br><div><div></div><div class="Wj3C7c"><br>> If you don't mind, I have some suggestions:<br>> 1) about __autoload: I think it's a great idea, and it will increase<br>> lifetype performance if you use it in a correct way, something like this:
<br>><br>> <?php<br>> $importList = array();<br>><br>> //This will not load class directly from classes path, just load it when you<br>> need it<br>> function import($classPath) {<br>> global $importList;
<br>> $classFullPath = APP_PATH.str_replace('.', '/', $classPath);<br>> $className = basename($classFullPath);<br>> $importList[$className] = $classFullPath.'.php';<br>> if(!file_exists($importList[$className])) {
<br>> throw new Exception('File Doesn\'t Exists<br>> ['.$importList[$className].']');<br>> }<br>> }<br>><br>> //Catch unloaded classes<br>> function __autoload($className) {
<br>> global $importList;<br>><br>> if(isset($importList[$className])) {<br>> include $importList[$className];<br>> } else {<br>> throw new Exception("Invalid Class Name [$className]");
<br>> }<br>> return $className;<br>> }<br>> ?><br>><br>> and about load a classes just use it like this<br>> import('class.action.admin.AdminAddPostAction ');<br>><br>> and keep your class file name exactly like ClassName.
<br><br></div></div>I don't see how this can help, please elaborate.<br><br>The goal for implementing class autoloading was to remove all those<br>annoying lt_include() statements at the top of each one of our class<br>
files. If we replace this:<br><br>lt_include( PLOG_CLASS_PATH."class/action/whatever.class.php" );<br><br>with your suggestion:<br><br>import( "class.action.Whatever" );<br><br>What did we gain here? If we're doing it to increase clarity and
<br>reduce code cruft, we gained nothing as we still one import()<br>statement per class. If we're doing it for performance purposes, we<br>might as well revert to lt_include() as it won't get any faster than<br>that.
<br><div class="Ih2E3d"><br>> 2) using the cache: smarty cache is great, but I think it's used in a wrong<br>> way,<br>> in each request, you already load [local files] and plugins and ... , which<br>> will not be used if the template is cached.
<br><br></div>There's some plugins that need to run regardless of the cached status<br>of the templates, such as those that register a filter in the<br>pipeline.<br><br>But there's already been some discussion about this topic recently and
<br>there's still time to tackle this issue in the next major release. Do<br>you happen to have a proposal on how to implement this?<br><div><div></div><div class="Wj3C7c"><br>> 3) loading operations[controllers maps]: you can store this array elements
<br>> in temp file and run a binary search on this array to get incoming operation<br>> action.<br>><br>> Regards,<br>> Ahmad<br>><br>><br>><br>> On Nov 9, 2007 1:47 PM, Mark Wu <<a href="mailto:markplace@gmail.com">
markplace@gmail.com</a>> wrote:<br>> > Actually, I saw that post several days ago .....<br>> ><br>> > I was frustrated when you try to use __autoload :( , it is really makes<br>> the<br>> > LifeType so so slow in windows platform ...because it increse thousands
<br>> > file_exist() execution time.<br>> ><br>> > I think we should mix the PHP4 skill in PHP5 implementation at this<br>> moment,<br>> > or it will cause our system to get very bad performance.
<br>> ><br>> > Actually, I really like __get, __set and __call in PHP5, we can use it to<br>> > redeuce the complexity of our dbobjects....<br>> ><br>> > For example, we can add a new property like $description without add new
<br>> > getter and setter method. And we still can use getDescription() method to<br>> > get property $description ... that's magic function for ...<br>> ><br>> > But, you know, it slow ....<br>
> ><br>> > Mark<br>> ><br>> ><br>> ><br>> ><br>> > > -----Original Message-----<br>> > > From: <a href="mailto:plog-svn-bounces@devel.lifetype.net">plog-svn-bounces@devel.lifetype.net
</a><br>> > > [mailto:<a href="mailto:plog-svn-bounces@devel.lifetype.net">plog-svn-bounces@devel.lifetype.net</a>] On Behalf Of<br>> > > Oscar Renalias<br>> > > Sent: Friday, November 09, 2007 7:35 PM
<br>> > > To: LifeType Developer List<br>> > > Subject: [pLog-svn] This is not fair<br>> > ><br>> > > It doesn't help if PHP implements lots of nice OOP features<br>> > > (that I was planning to use one day, such as Array iterators, "magic"
<br>> > > accessors via __get and __set, and so on) if by using them we<br>> > > incur in some pretty annoyingly high performance overheads... See for<br>> > > yourselves:<br>> > ><br>> > >
<a href="http://www.garfieldtech.com/blog/magic-benchmarks" target="_blank">http://www.garfieldtech.com/blog/magic-benchmarks</a><br>> > ><br>> > > I just wanted to vent my frustrations about this topic with you... :)
<br>> > ><br>> > > Oscar<br>> > > _______________________________________________<br>> > > pLog-svn mailing list<br>> > > <a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net
</a><br>> > > <a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">http://limedaley.com/mailman/listinfo/plog-svn</a><br>> ><br>> > _______________________________________________<br>
> > pLog-svn mailing list<br>> > <a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br>> > <a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">http://limedaley.com/mailman/listinfo/plog-svn
</a><br>> ><br>><br>><br>> _______________________________________________<br>> pLog-svn mailing list<br>> <a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br>> <a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">
http://limedaley.com/mailman/listinfo/plog-svn</a><br>><br>_______________________________________________<br>pLog-svn mailing list<br><a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br><a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">
http://limedaley.com/mailman/listinfo/plog-svn</a><br></div></div></blockquote></div><br>