Re: [PHP-DEV] PCRE caching

2017-03-05 Thread Rasmus Schultz
Thanks for clearing this up, Nikita :-) > Compiled expressions are cached between requests. However, they are not shared between processes That sounds good - it would likely very difficult (if not impossible) and likely would make only a marginal performance difference. All good, I think. > The

Re: [PHP-DEV] PCRE caching

2017-03-03 Thread Nikita Popov
On Wed, Mar 1, 2017 at 4:35 PM, Rasmus Schultz wrote: > Hey internals, > > I was wondering whether or how PCRE regular expression get parsed and > cached, and I found this answer on Stack Overflow: > > http://stackoverflow.com/questions/209906/compile-regex-in-php > > Do I understand this correct

Re: [PHP-DEV] PCRE caching

2017-03-01 Thread Ivan Enderlin
Hello, We can also use a LRU caching strategy with a pre-defined (or user-defined) number of expressions to keep in the cache. This would also be a good idea to track number of times a regular expression is used. If this number reaches a certain threshold, then we could automatically re-compi