Skip to content

Do not use proxy-decorators and event listeners when debug is skipped #277

@xepozz

Description

@xepozz

There are a few checks that disable data collecting:

But they do not unwrap proxied classes, like \Yiisoft\Yii\Debug\Collector\LoggerInterfaceProxy or any other.
Also they do not unsubscribe from event-dispatcher.

It may negatively impact performance.

An idea to control if data collecting is skipped:

  • Create a proxy class for *InterfaceProxy classes
  • All *InterfaceProxy must expose decorated class
  • If data collecting is skipped, call $proxy->getDecorated()->$method($args) directly
  • Otherwise call $proxy->$method($args)

Or add check is data collecting is skipped to each public method of proxy classes

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions