Feature #43193

Optimize Classloader

Added by Christopher Hlubek almost 9 years ago. Updated almost 9 years ago.

Status:
Rejected
Priority:
Should have
Category:
-
Target version:
-
Start date:
2012-11-21
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

The default FileBackend does an expiration check on any call to require, which costs quite some syscalls. For the classes cache we could generally disable expiration (maybe with a backend option). For frozen packages this is already the case, but in Production a package cannot be frozen.

#1

Updated by Robert Lemke almost 9 years ago

  • Status changed from New to Rejected

That's what freezable cache backends are for. In Production Flow uses a freezable cache backend for code caches and freezes it as soon as proxy classes have been written.

#2

Updated by Christopher Hlubek almost 9 years ago

Not exactly (there is no frozen code cache), but I also didn't notice, that for code caches the SimpleFileBackend is used, which doesn't do any expiration checks.

Robert Lemke wrote:

That's what freezable cache backends are for. In Production Flow uses a freezable cache backend for code caches and freezes it as soon as proxy classes have been written.

#3

Updated by Robert Lemke almost 9 years ago

Christopher Hlubek wrote:

Not exactly (there is no frozen code cache), but I also didn't notice, that for code caches the SimpleFileBackend is used, which doesn't do any expiration checks.

Robert Lemke wrote:

That's what freezable cache backends are for. In Production Flow uses a freezable cache backend for code caches and freezes it as soon as proxy classes have been written.

I was referring to "FreezableBackendInterface". In production the compiler will detect freezable cache backends and then freeze the code caches:

        if ($this->bootstrap->getContext()->isProduction() && $classesCacheBackend instanceof FreezableBackendInterface) {
            $classesCache->getBackend()->freeze();
        }

(see CoreCommandController)

Also available in: Atom PDF