Gmail Calendar Docs Reader La Web Más »
Grupos visitados recientemente | Ayuda | Acceder
Página principal de Grupos de Google
Routing with sf1.3
En este grupo hay demasiados temas que deben mostrarse primero. Para que este aparezca al principio de la lista, debes descartar esta opción para alguno de los anteriores.
Error al procesar tu solicitud. Por favor, inténtalo de nuevo.
marcar
  25 mensajes - Ocultar todos  -  Traducir todo al Traducido (ver todos los originales)
El grupo al cual envías entradas es un grupo Usenet. Si envías mensajes a este grupo, cualquier usuario de Internet podrá ver tu dirección de correo electrónico
Tu respuesta no se ha enviado.
Tu entrada se ha publicado correctamente.
 
De:
Para:
Cc:
Seguimiento:
Añadir Cc | Añadir seguimiento | Editar asunto
Asunto:
Validación:
Con fines de verificación, escribe los caracteres que veas en la imagen siguiente o los números que escuches haciendo clic en el icono de accesibilidad. Escucha y escribe los números que oyes.
 
Thomas Rabaix  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 28 oct 2009, 16:46
De: Thomas Rabaix <thomas.rab...@gmail.com>
Fecha: Wed, 28 Oct 2009 16:46:49 +0100
Local: Mié 28 oct 2009 16:46
Asunto: Routing with sf1.3
Hello,

I have done a small benchmark with routing implementation with sf1.2  
and sf1.3.

I have created 4 cache files with 500 routes in each files.
   - test 1 : symfony 1.2 , routing.yml.php - object creation in an  
array
   - test 2 : version "cache" symfony 1.2, serialized array with  
compiled routes from test 1
   - test 3 : version swOptimizeRoutesPlugin : array of serialized  
routes
   - test 4 : version symfony 1.3, a big array

Here the result (I have been running this test with php5.3 / macport):

# TEST 1 : sf1.2 / sfPatternRouting - object creation
# TEST 1 - file size: 398576.000000, include time: 0.022773, memory:  
2544656
# TEST 2 : sf1.2 / sfPatternRouting -  object deserialization as if  
cache is enabled
# TEST 2 - file size: 398576.000000, include time: 0.032223, memory:  
5787200
# TEST 3 : sf1.2 / swOptimizePatternRouting - array with serialized  
route informations
# TEST 3 - file size: 426672.000000, include time: 0.004196, memory:  
2183944
# TEST 4 : sf1.3 / sfPatternRouting like - full array
# TEST 4 - file  size: 652672.000000, include time: 0.036927, memory:  
*9573008*

Test file :
http://trac.symfony-project.org/browser/plugins/swOptimizeRoutesPlugi...

My first conclusion is that sf1.3 take more memory than any other  
implementations without any speed gain. Of course I might missing  
something important ...

my 2cents

Thomas


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabian Lange  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 28 oct 2009, 22:58
De: Fabian Lange <fabian.la...@symfony-project.com>
Fecha: Wed, 28 Oct 2009 22:58:53 +0100
Local: Mié 28 oct 2009 22:58
Asunto: Re: [symfony-devs] Routing with sf1.3

Hi Thomas,

I was not able to get your code running easily.
Here a drop in zip file with my tests. I also noted you were not
always passing true to memory_get_usage. any reason for that?

To eliminate any chance for error i start with a routing.yml file
which i generate with 1000 routes (high number but not too
unrealistic)
After that I generate the 1.2 and 1.3 version of the confighandler file
Then i am loading this configuration into pattern routing and running
a query against them
I monkeypatched the sfPatternRouting to make them running isolated.
this should not have any impact on the measurements

Run on Windows 7 with PHP 5.2.8:

# Creating routing yml with 1000 routes
# creating 1.2 config
# time: 0.394403, memory: 1792.00kb
# creating 1.3 config
# time: 0.750202, memory: 6656.00kb
# loading 1.2 config
# time: 0.056127, memory: 0.00kb
# loading 1.3 config
# time: 0.304124, memory: 24832.00kb
# searching 1.2 route
# time: 0.223467, memory: 0.00kb
ok 1
# searching 1.3 route
# time: 0.006030, memory: 0.00kb
ok 2
1..2
 Looks like everything went fine.

1.2 uses less memory and is faster on generation. This is
understandable, because 1.3 moves the route compilation to here.

loading the config is really interesting. it does'nt take memory for
1.2 (i don't know why) and it is faster than in 1.3 (because there is
less to load, because less was generated). It takes TONS of memory for
1.3

then finding the route is WAY faster in 1.3 than in 1.2. However,
assuming this simple uri against simple route matching is ok for our
test, the gain in parse() does not offset the heavy lifting on loading
the configuration.
Also the memory consumption is not really nice in 1.3

@Fabien, any immediate ideas? We have to work on this one still

Fabian

  performance.zip
15 K Descargar

    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabian Lange  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 28 oct 2009, 23:57
De: Fabian Lange <fabian.la...@symfony-project.com>
Fecha: Wed, 28 Oct 2009 23:57:54 +0100
Local: Mié 28 oct 2009 23:57
Asunto: Re: [symfony-devs] Routing with sf1.3

Hi again,
I really dont know if this is a PHP glitch or something, but I have a
much better solution.
instead of generating the new sfRoute(...big array ...) stuff with the
config handler i do this:

        $data[] = sprintf('$this->routes[\'%s\'] =
unserialize(\'%s\');', $name, serialize($route));
        $date[] =
sprintf('$this->routes[\'%s\']->setDefaultParameters($this->defaultParamete rs);',
$name);

So when this config file is generated all routes are compiled and
serialized to this file (this is similar to how 1.2 worked with
caching)
after doing so the file is just included in the pattern routing and
fills directly the $this->routes by unserializing.

I do not know why this is faster and consumes less memory but that is
it. I speculate that the hundreds of arrays the generated file
contains is just bad for php.
Here the results:

# Creating routing yml with 1000 routes
# creating 1.2 config
# time: 0.393291, memory: 1792.00kb
# creating 1.3 config
# time: 0.666392, memory: 5632.00kb
# loading 1.2 config
# time: 0.055146, memory: 1792.00kb
# loading 1.3 config
# time: 0.111888, memory: 5120.00kb
# searching 1.2 route
# time: 0.222738, memory: 5888.00kb
ok 1
# searching 1.3 route
# time: 0.006125, memory: 0.00kb
ok 2
1..2
 Looks like everything went fine.

-> faster creation of config file & less memory. 1/3 execution time
and 1/5 memory consumption on loading. But I admit i do not trust the
memory figures.
With my change it is now half time for loading the config and about
the same memory (you have to add the memory in searching for 1.2
because it builds the routes then (lazy))

Also the generated routing.yml.php is about half of the current 1.3 size.

I attached the improved version. Please crosscheck

Fabian

On Wed, Oct 28, 2009 at 10:58 PM, Fabian Lange

  performance2.zip
15 K Descargar

    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Thomas Rabaix  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 00:08
De: Thomas Rabaix <thomas.rab...@gmail.com>
Fecha: Thu, 29 Oct 2009 00:08:14 +0100
Local: Jue 29 oct 2009 00:08
Asunto: Re: [symfony-devs] Re: Routing with sf1.3

I am glad that you get the time to look at this issue. I don't know if you
have a look into the plugin, but I don't think symfony or either PHP can
deal with this work : loading this information into memory is too slow
: 304ms to load 1000 routes (maybe it will be 90ms for 200 routes).

This logic can be easily ported into the webserver's configuration (maybe
only in production) with mod_rewrite, so the matching is not done at the
symfony/php level.

The next thing, route information should be loaded on demand [1], each page
can have an average of 20-30 routes loaded (why the other routes should be
loaded ?). But there is another problem, PHP is slow to deserialize string,
so loading on demand routes will be slow...

Now, I am pretty confident that the native php serializer is not suitable
for routing, maybe the sfRoute should have its own serializer/deserializer.
So in this case loading routes can be quicker. I have not try this because
this will require to patch symfony, I don't want to propose this as a
plugin.

[1] on demand : the cache system only hold an array of serialized routes :
array(
 'my_route_1' => array('sfDoctrineRoute', "serialized data"),
 'my_route_2' => array('sfDoctrineRoute', "serialized data"),
 [...]
);

On Wed, Oct 28, 2009 at 10:58 PM, Fabian Lange <

--
Thomas Rabaix
http://rabaix.net

    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabien Potencier  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 09:17
De: Fabien Potencier <fabien.potenc...@symfony-project.com>
Fecha: Thu, 29 Oct 2009 09:17:17 +0100
Local: Jue 29 oct 2009 09:17
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
I don't have time today to have a look at the issue, but keep in mind
that the speed of the loading is not the whole picture. We also need to
have a fast route generation, especially when you need to generate 30-50
links per page. So, we need to find a good balance between loading speed
and generation speed.

As far as mod_rewrite is concerned, this won't work as the symfony
routing is more than just pattern matching.

Fabien

--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.org | fabien.potencier.org
Tél: +33 1 40 99 80 80


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Thomas Rabaix  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 10:09
De: Thomas Rabaix <thomas.rab...@gmail.com>
Fecha: Thu, 29 Oct 2009 10:09:23 +0100
Local: Jue 29 oct 2009 10:09
Asunto: Re: [symfony-devs] Re: Routing with sf1.3

The plugin is just a proof of concept, but the apache mod_rewrite version is
working fine. The mod_rewrite just add a new variable 'sf_route' so the
sfRouting does not have to find the route. Of course, a custom sfRoute
object can add more logic into the "match" method. But this should not be
advocated, just see the number... finding a route with regular expression is
"slow" and if the dev add another extra layer of check, this will be _very_
slow ...

On Thu, Oct 29, 2009 at 9:17 AM, Fabien Potencier <

--
Thomas Rabaix
http://rabaix.net

    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabien Potencier  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 10:35
De: Fabien Potencier <fabien.potenc...@symfony-project.com>
Fecha: Thu, 29 Oct 2009 10:35:04 +0100
Local: Jue 29 oct 2009 10:35
Asunto: Re: [symfony-devs] Re: Routing with sf1.3

Thomas Rabaix wrote:
> The plugin is just a proof of concept, but the apache mod_rewrite
> version is working fine. The mod_rewrite just add a new variable
> 'sf_route' so the sfRouting does not have to find the route. Of course,
> a custom sfRoute object can add more logic into the "match" method. But
> this should not be advocated, just see the number... finding a route
> with regular expression is "slow" and if the dev add another extra layer
> of check, this will be _very_ slow ...

So, basically, you want to remove all the advanced features of the
symfony routing? I fail to understand how a mod_rewrite configuration
can "replace" the actual routing.

Also, keep in mind that we also need something fast to generate a route.

Fabien


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Lukas Kahwe Smith  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 10:52
De: Lukas Kahwe Smith <m...@pooteeweet.org>
Fecha: Thu, 29 Oct 2009 10:52:25 +0100
Local: Jue 29 oct 2009 10:52
Asunto: Re: [symfony-devs] Re: Routing with sf1.3

On 29.10.2009, at 10:35, Fabien Potencier wrote:

Well I do not know what the yahoo guys did in the end, but dealing  
with lots of different routes is one of the key performance issues  
from what I have seen. So it makes sense to allow people to be able to  
replace it with more streamlined approaches if these are sufficient  
for them. However the default should stick to the full feature  
solution imho .. not only for BC but also because most people do not  
really suffer much at all from the overhead that the routing system  
brings.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Thomas Rabaix  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 11:56
De: Thomas Rabaix <thomas.rab...@gmail.com>
Fecha: Thu, 29 Oct 2009 11:56:58 +0100
Local: Jue 29 oct 2009 11:56
Asunto: Re: [symfony-devs] Re: Routing with sf1.3

Does the advance features deal with route matching ? the mod_rewrite will
not replace the routing, mod_rewrite is only used to quickly find the route.
That's all [1]

swOptimizeRoutesPlugin is just a proof of concept, And it will break routes
which are using a custom sfRoute::match method. I am pretty sure that should
concern only 0.1% of symfony users, and these users will have enough
experiences to not used the plugin !

Now the original idea of the post was to show that the current
implementation as 1.3 is slow and take a lot of memory. That was my first
concern.

I am agree with Fabian, the routing should be splited into a matcher and a
generater. (and/or maybe use some kind of namespace)

[1]
http://trac.symfony-project.org/browser/plugins/swOptimizeRoutesPlugi...

On Thu, Oct 29, 2009 at 10:35 AM, Fabien Potencier <

...

leer más »


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
david  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 13:50
De: david <da...@inspiredthinking.co.uk>
Fecha: Thu, 29 Oct 2009 13:50:52 +0100
Local: Jue 29 oct 2009 13:50
Asunto: Re: [symfony-devs] Re: Routing with sf1.3

While it's rough around the edges and can be enhanced a lot more -  
attached is an extension of the test framework that Fabien L mailed  
earlier.

With the 13a version:
   37% reduction in mem usage
   30% improvement in speed
   40% improvement in the generated route cache file size

If you're interested I also have some real performance metrics available.

Regards,

David

On Thu, 29 Oct 2009 11:56:58 +0100, Thomas Rabaix  

...

leer más »

  routing.tar.gz
14 K Descargar

    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabian Lange  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 16:09
De: Fabian Lange <fabian.la...@symfony-project.com>
Fecha: Thu, 29 Oct 2009 16:09:35 +0100
Local: Jue 29 oct 2009 16:09
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
Hi David,

I finalized the initial polish for the measurements and added them to svn:
http://svn.symfony-project.org/tools/routing_performance/

I added a version from 1.2, your proposal and my patch.

I would appreciate if some more people could help me with the stuff in Todo:
 - create a realistic routing.yml generator
 - create a realistig usage of the files
(loadConfiguration/parse/findurl/generate....)

I think there is one important point open for discussion:
What is the difference between generated routing config file and the cache file.
i think the difference blurs, but the cache is configurable (apc
memcache, db... ) while the config file is not.
Putting the full routes into the config files looks exceptionally
wrong for me. But if it helps we should consider dropping the cache
support (which caused only pain the last months)

Fabian


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
David Ashwood  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 16:59
De: David Ashwood <da...@inspiredthinking.co.uk>
Fecha: Thu, 29 Oct 2009 16:59:57 +0100
Local: Jue 29 oct 2009 16:59
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
Cool - I'll take a look.
Would be handy if there was a resource available that allowed people to
post their routing files - the more live/"real world" data available -
the better.  I'm not sure people would like to post their routing files
to the general group...

The first version I sent was really just a proof of concept - further
refinement significantly improves matters.  The current version does a
very simple comparison of arrays - which has since been improved.

Further improvement will come from issue you mentioned - regarding the
config file & cache.

I think there's a number of way of solving the problem in a way that
degrades gracefully from an optimal configuration - and hence would be
usable generally.

Currently metrics tends to show performance bottlenecks in other areas -
rather than with the routing side of things.

Locally I did extend the final test part of the "routing performance" to
include random routes and not-found routes.  I did also find that
running 2 sf 1.3 config file generators without destroying the
routingConfigHandler caused the subsequent tests to abort.

Regards,

David
+34 608 929 403


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabian Lange  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 29 oct 2009, 18:14
De: Fabian Lange <fabian.la...@symfony-project.com>
Fecha: Thu, 29 Oct 2009 18:14:40 +0100
Local: Jue 29 oct 2009 18:14
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
Hi David,
feel free to send me patches for our performance test suite.
I will incorporate them until i find a way to give access to everybody.

So if you have something new i will include it.

Ideally we have then some kind of incubation of a new way for routing
to be configured. And we can benchmark them.

So that before release 1.3 we can find a good performing solution.
To be included in 1.3 i would like to accept only "small" backwards
compatible changes that have a big net effect.

Fabian


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
arrigby@gmail.com  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 30 oct 2009, 13:37
De: "arri...@gmail.com" <arri...@gmail.com>
Fecha: Fri, 30 Oct 2009 05:37:09 -0700 (PDT)
Local: Vie 30 oct 2009 13:37
Asunto: Re: Routing with sf1.3
Hi,

Here is output from my run of the tests - I cannot run david's
benchmark as splFixedArray is not available in my php build, though
SPL is shown as available in php_info(). I'm running php 5.2.11.

Re: config/cache - in 1.3 our config_routing.yml.php is 2,054,492
bytes and consists of 628 routes. These are mostly propel routes.
However, with APC opcode caching we find this loads very quickly (last
time I benchmarked it was something like 0.06 seconds) Our problem is
matching routes - if we have a page with 50 or so links, the majority
of the time is spent matching the route (something like 1 second out
of total request time of 1.2 seconds) If we enable the APC variable
cache and lookup_dedicated_cache_keys once the route is matched, the
performance is ok, however we have a lot of route variations and I can
see this using a large amount of RAM. We cannot run without this cache
as performance is just too slow. Been a while since I looked at this,
but can put together some stats if it's useful?

[andyr@cysrln03-dev-andyr-vm]~/projects/trunk-local-fs/lib/vendor/
symfony/test/routing_performance% php routing_performance.php 1.2|grep
"^#"
# testing patch 1.2
# This is equivalent to the latest version from the 1.2 branch.
# Creating routing yml with 1500+ routes
# 1.2 Routing - Creating Config
# time: 1.713294, memory: 2304.00kb
# 1.2 Routing - Loading Config
# time: 0.193375, memory: 10240.00kb
# 1.2 Routing - Searching Routes 10 times
# 1.2 Routing - Generating Routes 20 times
# time: 1.633093, memory: 3328.00kb
# 1.2 Routing - Real World Test - Accumulated data
# time: 1.826847, memory: 13568.00kb
# file: 211.00kb
[andyr@cysrln03-dev-andyr-vm]~/projects/trunk-local-fs/lib/vendor/
symfony/test/routing_performance% php routing_performance.php david|
grep "^#"
# testing patch david
# Creating routing yml with 1500+ routes
# david Routing - Creating Config
PHP Fatal error:  Class 'splFixedArray' not found in /home/andyr/
projects/trunk-local-fs/lib/vendor/symfony/test/routing_performance/
david/sfRoutingConfigHandlerNew.class.php on line 84
[andyr@cysrln03-dev-andyr-vm]~/projects/trunk-local-fs/lib/vendor/
symfony/test/routing_performance% php routing_performance.php fabian|
grep "^#"
# testing patch fabian
# Creating routing yml with 1500+ routes
# fabian Routing - Creating Config
# time: 2.712385, memory: 9472.00kb
# fabian Routing - Loading Config
# time: 0.421317, memory: 9216.00kb
# fabian Routing - Searching Routes 10 times
# fabian Routing - Generating Routes 20 times
# time: 0.814632, memory: 0.00kb
# fabian Routing - Real World Test - Accumulated data
# time: 1.236377, memory: 9216.00kb
# file: 1899.08kb

Thanks,
Andy.

On Oct 29, 5:14 pm, Fabian Lange <fabian.la...@symfony-project.com>
wrote:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
David Ashwood  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 30 oct 2009, 13:49
De: David Ashwood <da...@inspiredthinking.co.uk>
Fecha: Fri, 30 Oct 2009 13:49:42 +0100
Local: Vie 30 oct 2009 13:49
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
I ran some tests last night on the old performance framework before
downloading the latest version and starting to migrate my changes into
the code - this is only the compression based changes - nothing
intelligent happening yet:

# Creating routing yml with 1000 routes
# creating 1.2 config
# time: 0.286042, memory: 1792.00kb
# creating 1.3 config
# time: 0.586565, memory: 7680.00kb
# creating 1.3a config
# time: 0.639807, memory: 3328.00kb
# loading 1.2 config
# time: 0.113459, memory: 4096.00kb
# loading 1.3 config
# time: 0.648253, memory: 23808.00kb
# loading 1.3a config
# time: 0.409712, memory: 6912.00kb
# searching 1.2 route
# time: 0.205716, memory: 0.00kb
ok 1
# searching 1.3 route
# time: 0.004365, memory: 0.00kb
ok 2
# searching 1.3a route
# time: 0.004388, memory: 0.00kb
ok 3
FileSize with 1.3 Default: 2126812 routing.php
FileSize with 1.3a : 1099505  routing.php

This is only from targeting compression - I've not looked at any kind
of intelligent mapping/loading yet.  The splArray out of habit (I've
been working on a project recently where the splDatastructures are
used).  I'll ensure the next version is compatible.

How are you using/how have you configured the APC with sf?
I ask as I've been playing with some autodetection code - the intention
being to use it if it's available - otherwise to fall back to more
conventional approaches.


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
arrigby@gmail.com  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 30 oct 2009, 15:40
De: "arri...@gmail.com" <arri...@gmail.com>
Fecha: Fri, 30 Oct 2009 07:40:05 -0700 (PDT)
Local: Vie 30 oct 2009 15:40
Asunto: Re: Routing with sf1.3
Hi,

We use APC as the opcode cache, so all *.php files are cached by
default - we had to increase the default apc.max_file_size to alow it
to cache the routing cache file (config_routing.yml.php)

We also use the variable cache of APC to speed up routing matches. We
have this entry in factories.yml under routing:

      lookup_cache_dedicated_keys:      true
      cache:
        class: sfAPCCache
        param:
          automatic_cleaning_factor: 0
          lifetime:                  1800

As I said, the opcode cache pretty much solves the route loading speed
for us, our issue is the route matching speed without the above cache
setting.

here is our apc.ini

extension=apc.so
apc.shm_size=256
apc.ttl=600
apc.gc_ttl=300
apc.user_ttl=600
apc.max_file_size=5M
apc.num_files_hint=6000

On Oct 30, 12:49 pm, David Ashwood <da...@inspiredthinking.co.uk>
wrote:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
arrigby@gmail.com  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 30 oct 2009, 16:01
De: "arri...@gmail.com" <arri...@gmail.com>
Fecha: Fri, 30 Oct 2009 08:01:43 -0700 (PDT)
Local: Vie 30 oct 2009 16:01
Asunto: Re: Routing with sf1.3
Hi,

I've just disabled the apc cache under the routing: section in
factories.yml and here are some stats:

Total Incl. Wall Time (microsec):       3,082,027 microsecs

Then, ordered by number of calls

sfRoute::mergeArrays    56,978  17.2%   394,924         12.8%   394,924         12.8%
is_array        47,957  14.4%   54,068  1.8%    54,068  1.8%
array_diff_key  28,556  8.6%    78,547  2.5%    78,547  2.5%
sfRoute::getDefaultParameters   28,489  8.6%    63,969  2.1%    63,969
2.1%
sfRoute::setDefaultParameters   28,425  8.6%    85,397  2.8%    85,397
2.8%
sfRoute::matchesParameters      28,422  8.6%    1,684,034       54.6%   1,028,030
33.4%
sfRequestRoute::matchesParameters       27,333  8.2%    1,889,048       61.3%
259,590         8.4%
sfObjectRoute::matchesParameters        27,333  8.2%    2,424,934       78.7%
379,442         12.3%
sfObjectRoute::convertObjectToArray     19,363  5.8%    156,451         5.1%
136,329         4.4%
preg_match      16,348  4.9%    59,968  1.9%    59,968  1.9%
array_keys      14,230  4.3%    26,658  0.9%    26,658  0.9%

So, sfObjectRoute::matchesParameters is called 27,333 times taking
2,424,934 microseconds which it ~78% of the total time for the request

There are only 66 calls to url_for():

sfPatternRouting::generate      67      0.0%    2,934,777       95.2%   2,917   0.1%
sfWebController::genUrl         67      0.0%    2,942,070       95.5%   3,345   0.1%
url_for         66      0.0%    2,882,401       93.5%   1,436   0.0%
url_for1        66      0.0%    2,879,410       93.4%   1,336   0.0%

all the calls to url_for() collectively take 2,882,401 microseconds
~93% of total request time.

On Oct 30, 2:40 pm, "arri...@gmail.com" <arri...@gmail.com> wrote:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Thomas Rabaix  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 30 oct 2009, 16:18
De: Thomas Rabaix <thomas.rab...@gmail.com>
Fecha: Fri, 30 Oct 2009 16:18:22 +0100
Local: Vie 30 oct 2009 16:18
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
So you are not using named routes in your templates ?

matchesParameters is only call if you use 'module/action'. Which is a  
bad practise.

On 30 oct. 2009, at 16:01, arri...@gmail.com wrote:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
arrigby@gmail.com  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 30 oct 2009, 16:40
De: "arri...@gmail.com" <arri...@gmail.com>
Fecha: Fri, 30 Oct 2009 08:40:06 -0700 (PDT)
Local: Vie 30 oct 2009 16:40
Asunto: Re: Routing with sf1.3
Hi,

No we are not using named routes. I'm not sure why this is considered
bad practice - as far as I aware this is a feature of the framework.
The documentation IMO doesn't discourage this.

Changing to named routes would be quite an undertaking.

Thanks,
Andy

On Oct 30, 3:18 pm, Thomas Rabaix <thomas.rab...@gmail.com> wrote:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabian Lange  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 30 oct 2009, 20:34
De: Fabian Lange <fabian.la...@symfony-project.com>
Fecha: Fri, 30 Oct 2009 20:34:47 +0100
Local: Vie 30 oct 2009 20:34
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
Hi David,
i think the test harness is now pretty stable. Can you send me a
version of your code so i can update it?
Thomas, do you have any new stuff?

Regarding the Config vs. Cache issue:
Lets define it as this: The cache holds parsing results, while the
configuration supplies the information to generate results.

We currently target the configuration. Fabien changed that from 1.2 to
1.3 so that the runtime performance (searching, generating) is better.
However the initial performance suffered from that. Our goal should eb
to eliminate that, and Davids benchmarks look most promising.

What is important is that we update the routes used in the harness.
So I am calling for input on the routes used in your application. Send
me one or two of the most "complicated" ones.

My plan is to have a proposal ready for the BugHuntDay, where I can
discuss with Fabien in person about the solution to use in sf 1.3

Fabian


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Thomas Rabaix  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 31 oct 2009, 11:24
De: Thomas Rabaix <thomas.rab...@gmail.com>
Fecha: Sat, 31 Oct 2009 11:24:33 +0100
Local: Sáb 31 oct 2009 11:24
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
Hello,

I didn't have the time to look at it for now, I will try something  
before the BugHuntDay.

Thomas

On 30 oct. 2009, at 20:34, Fabian Lange wrote:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
David Ashwood  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 31 oct 2009, 14:11
De: David Ashwood <da...@inspiredthinking.co.uk>
Fecha: Sat, 31 Oct 2009 14:11:14 +0100
Local: Sáb 31 oct 2009 14:11
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
I'm hoping to wander over to the PHP conf in Barcelona for a couple of
hours today but I'll have an update by Monday.  I have a few versions on
the go to help compare optimisations side-by-side.

There's probably another week needed for tweaking/iterations/metrics but
there should be a week between having options and the BH day.

I'm currently looking into how best to optimize the flow of the code to
minimise repeating what's already been generated. I'm also attempting to
generate the cache in a way that will facilitate chunking of the
generated routes to allow better lazy loading of specific routes.  This
should make the initial loading quicker, and handle the use case of
"module/action" routes faster.

Profiling with zend suggests that a large portion of cycles is used in
the yml processing.  Not surprising - but it bears investigation as to
if the code can be optimised.  Around 40% of the total test time
currently is in sfYaml*.php - half in sfYamlInline and half
sfYamlParser.

Regards,

David


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabian Lange  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 31 oct 2009, 20:19
De: Fabian Lange <fabian.la...@symfony-project.com>
Fecha: Sat, 31 Oct 2009 20:19:35 +0100
Local: Sáb 31 oct 2009 20:19
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
Hi David,
great. I am looking forward for your proposals.
The sfYaml doesn't need to be tunes, because it is done only once in
the real app.
I included it in the test harness to make sure the routing config is
generated properly and we can use one generated yaml as base for the
test runs.

ok, if you do find some big chance to increase performance in sfYaml:
feel free to open a ticket :)

I will instrument a live app to logg all actions made with the
routing, so i get a better feeling of the usage to improve the harness

Fabian

On Sat, Oct 31, 2009 at 2:11 PM, David Ashwood


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
KupoKoMaPa  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 5 nov 2009, 16:26
De: KupoKoMaPa <kupokom...@gmail.com>
Fecha: Thu, 5 Nov 2009 07:26:20 -0800 (PST)
Local: Jue 5 nov 2009 16:26
Asunto: Re: Routing with sf1.3
I can attest for the bad memory in generating routes. I am using a lot
of url_for() in a batch script to generate the sitemap of the site
(100,000) URLs and the script dies out of memory (256MB)

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried
to allocate 4864 bytes) in symfony/routing/sfRoute.class.php(229) :
runtime-created function on line 1

I will be able to test the changes you are making if they will
actually improve the memory usage in the generating stage.

On 31 Окт, 21:19, Fabian Lange <fabian.la...@symfony-project.com>
wrote:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fabian Lange  
Ver perfil   Traducir al Traducido (ver original)
 Más opciones 5 nov 2009, 20:21
De: Fabian Lange <fabian.la...@symfony-project.com>
Fecha: Thu, 5 Nov 2009 20:21:54 +0100
Local: Jue 5 nov 2009 20:21
Asunto: Re: [symfony-devs] Re: Routing with sf1.3
Can you give an example of the routes you are generating?
is it just the amount of routes you are generating?

Are you using a cache? Which symfony version?

Fabian

2009/11/5 KupoKoMaPa <kupokom...@gmail.com>:


    Reenviar  
Debes registrarte antes de enviar mensajes.
Para enviar una entrada, antes deberás formar parte del grupo.
Antes de enviar entradas, actualiza tu alias en la configuración de la suscripción.
No dispones del permiso necesario para enviar entradas.
Fin de los mensajes
« Volver a “Debates” « Tema más reciente     Tema anterior »

Crear un grupo - Grupos de Google - Página principal de Google - Condiciones del servicio - Política de privacidad
©2010 Google