doxter
doxter copied to clipboard
Performance issues with doxter field
Describe the bug
Hi, it seeems that using doxter field makes some additional db queries when we output its contents. This is noticable when we make longer entry listing, for example with 100 entries, page takes 10 seconds to load while without doxter field it takes somehting like 700ms.
Steps to reproduce
- Use doxter field
- Output it into twig template, when listing entries
Craft CMS version
4.3.10
Plugin version
5.0.4
Multi-site?
No
Additional context
No response
There shouldn't be anything like that, the output for the field is incredibly simple, apart from the parsing part, which is all PHP-based. I can't immediately see any reason why there would be performance issues.
For example, I've tested the following scenarios:
Single entry, multiple calls
{% for i in 1..100 %}
{{ entry.doxter | doxter({
parseShortcodes: true,
parseReferenceTags: true,
addHeaderAnchors: true,
}) }}
{% endfor %}
Multiple entries (100), single call
{% for entry in craft.entries.section('doxter').all() %}
{{ entry.doxter | doxter({
parseShortcodes: true,
parseReferenceTags: true,
addHeaderAnchors: true,
}) }}
{% endfor %}
And while there's a little noticeable slowdown (an extra 1s) it's certainly not that slow. Anything else you can do on your end to reduce it as a test case to isolate things?
@piotrpog Do you by any chance have entry or asset reference tags, for example {entry:123}, in your field content?