Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292343

Investigate possibilities to parse attributes without reflection

$
0
0

Problem/Motivation

Reflecting every class and method defined in a Drupal install is both a performance and memory nightmare.

Steps to reproduce

Proposed resolution

There are two solutions:

  1. Move nikic/php-parser to runtime, use it on classes, it has a constant expression evaluate feature and attributes are using such. This is going to a lot of fun especially cross class constants. For performance, this solution would use #3486503: Add a core FileCache implementation that is database-backed. The drawback is an awful lot of effort would need to go into this.
  2. Swallow the bitter pill and ship core/modules with attributes dumped. The drawback and it's a major one is development becomes harder as something needs to re-dump attributes on file change, manually or automatically. Of course many projects have went down this route, most famously perhaps sass --watch and cargo watch and they lived to tell the tale. https://github.com/olvlvl/composer-attribute-collector/ is a good start but it likely would need to changed to fork for every class or project at least otherwise the memory issue is back.

Remaining tasks

Decide whether to do #1 or #2 and how.

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 292343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>