doxter icon indicating copy to clipboard operation
doxter copied to clipboard

Performance issues with doxter field

Open piotrpog opened this issue 2 years ago • 2 comments

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

  1. Use doxter field
  2. 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

piotrpog avatar Mar 02 '23 18:03 piotrpog

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?

engram-design avatar Mar 03 '23 04:03 engram-design

@piotrpog Do you by any chance have entry or asset reference tags, for example {entry:123}, in your field content?

bencroker avatar Mar 03 '23 14:03 bencroker