Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Spin-off from #659788: [meta issue] theme('field') is too slow, which is inhibiting its more widespread use. One of several patches aimed at optimizing theme('field') while still leaving it as a template implementation rather than a function implementation. Will provide benchmarks once #538164: Comment body as field lands, since that's the driving use-case.
Comment | File | Size | Author |
---|---|---|---|
optimize-drupal_discover_template.patch | 2.27 KB | effulgentsia | |
Comments
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commented+1 for this optimization. subscribe.
Comment #3
yched CreditAttribution: yched commentedAdding a static cache definitely makes sense. I'd be interested in the bench results.
- I'm wondering about the performance impact of using a potentially fairly long string as an array key
$key = implode(',', $paths) . ':' . implode(',', $suggestions) . ':' . $extension;
- Should probably use a comment to explain why it doesn't use drupal_static() ?
- Isn't array_key_exists() notably slow ?
Comment #7
catchSubscribing.
Comment #8
effulgentsia CreditAttribution: effulgentsia commentedNow that comment body as field is in, I'll post benchmarks soon. But, I prefer #678714: Unify use of theme hook / template suggestions, fix clobbering problems, and improve suggestion discovery performance, which would make this one irrelevant.
Comment #9
webchick#678714: Unify use of theme hook / template suggestions, fix clobbering problems, and improve suggestion discovery performance is in. Close this?
Comment #10
catchYep.