2011-05-04 08:41, Domas Mituzas skrev:
> Ohi,
> 
>> The time it takes to execute the code that glues together the regexps
>> will be insignificant compared to actually executing the regexps for any
>> article larger than a few hundred bytes.  
> 
> Well, you did an edge case - a long line. Actually, try replacing spaces with 
> newlines, and you will get 25x cost difference ;-) 

A single long line containing no markup is indeed an edge case, but it
is a good reference case since it is the input where the parser will run
at its fastest.

Replacing the spaces with newlines will cause a tenfold increase in the
execution time.  Sure, in relative numbers less is time spent executing
regexps, but in absolute numbers, more time is spent there.

/Andreas

samples  %        app name                 symbol name
283       8.6044  libphp5.so               zend_hash_quick_find
188       5.7160  libpcre.so.3.12.1        /lib/libpcre.so.3.12.1
177       5.3816  libphp5.so               zend_parse_va_args
165       5.0167  libphp5.so               zend_do_fcall_common_helper_SPEC
160       4.8647  libphp5.so               __i686.get_pc_thunk.bx
131       3.9830  libphp5.so               zend_hash_find
127       3.8614  libphp5.so               _zval_ptr_dtor
87        2.6452  libc-2.11.2.so           memcpy
82        2.4932  libphp5.so               _zend_mm_alloc_canary_int
79        2.4019  libphp5.so               zend_get_hash_value
72        2.1891  libphp5.so               _zend_mm_free_canary_int
59        1.7939  libphp5.so               zend_std_read_property
55        1.6722  libphp5.so               execute
52        1.5810  libphp5.so               suhosin_get_config
51        1.5506  libphp5.so
zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST
48        1.4594  libphp5.so               zendparse


>> But the top speed of the parser (in bytes/seconds) will be largely 
>> unaffected.
> 
> Damn!
> 
> Domas
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> 


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to