Jump to content

hProj

New Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by hProj

  1. For those still looking for an answer on the subject, here is your answer: http://zend-framewor...84p4657525.html I have not attempted another benchmark yet, and I probably won't. I'm currently using Symfony and I'm pretty fond of it, it's rather late to change my mind
  2. Hello everybody, I'm writing a Symfony2 command to generate classes and retain code from existent files that it tagged with a certain annotation. I'm using Reflection to inspect the existent classes. So far, I've managed to retain methods, but properties are giving me issues. This is my code: protected function retainCode($from, $to) { $class = new \ReflectionClass($from); $file = $class->getFileName(); $stream=fopen($to, 'w'); //Check properties foreach ($class->getProperties() as $property) { $reader = new \Doctrine\Common\Annotations\AnnotationReader(); $annotation = $reader->getPropertyAnnotations($property, 'RetainCode'); if ($annotation != null) { $contents = file($file); $start_line = $property->getStartLine() - 1; $prefix=$property->getDocComment(); $code = PHP_EOL.' '.$prefix.PHP_EOL.implode("", array_slice($contents, $start_line, ($property->getEndLine()-$start_line))); fwrite($stream, $code); } } //Check methods foreach ($class->getMethods() as $method) { $reader = new \Doctrine\Common\Annotations\AnnotationReader(); $annotation = $reader->getMethodAnnotations($method, 'RetainCode'); if ($annotation != null) { $contents = file($file); $start_line = $method->getStartLine() - 1; $prefix=$method->getDocComment(); $code = PHP_EOL.' '.$prefix.PHP_EOL.implode("", array_slice($contents, $start_line, ($method->getEndLine()-$start_line))); fwrite($stream, $code); } } fclose($stream); } The implementation for methods works, but \ReflectionProperty does not contain any methods to get the position of the defined property. (Seems to me it should actually have such option) Is there any way to get this, in a proper way? Thanks in advance!
  3. Indeed. The negative results just keep summing up, wherever I look. In the end Symfony just seems the best option for heavy-weighted and high performing applications. Although my testresults are not quite accurate and trustworthy, I've seen enough to conclude my decision. In further comparison I used xhprof to profile the calls, and those concluded in 17k calls for Symfony and 35k for ZF2, both using Doctrine. That's somewhat more as in your results x) With your permission, I'd like to use your results in my documentation, since they're the most recent ones I have seen so far. Thanks a lot!
  4. Hello everybody, First of all, I'm new to PHP Frameworks, let alone PHP itself. I've been researching and comparing several PHP frameworks and came to a final comparison between Symfony 2 and Zend Framework 2, which seemed best for the context of my assignment (where performance is of the essence). Now I've been reading a lot of negative acticles and blogs about Zend Framework 2. It is supposed to be faster, but tests show the opposite: http://www.enrise.co...-2-performance/ http://www.piprime.f...web-frameworks/ http://www.ruilog.co...f0e42cf705.html So I started testing them myself. This came out: Dafuq. And yet again with 2 requests and 1 concurrent call: Zend Framework 2: ZF2, ZendSkeletonApplication and Doctrine 2 implementation Zend Framework 1: ZF1, existing fully-operational application, with various extensions. Symfony 2: Symfony 2 with Doctrine 2 implementation. It's always responding after 5 seconds or more... Now I'm also new at benchmarking, but isn't this supposed to be around the same as loading the page in a browser? Because it seems to load in less then a minute on windows. The pages I'm benchmarking select a table at the size of 500 rows. But even if I simply make them 'hello world' pages, ZF2 still uses 5s+. So it can't be the ORM. So I tried to find the source with xhprof, but that obviously gave me a regular response time, about less then a minute. I have no idea what is causing my benchmarks to give this weird result, and I was kind of hoping anybody could help me with this matter. Does anybody have any idea what could've caused these results? It seems to me it's caused by some configuration fault, but I have no clue where to start. Thanks in advance...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.