Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues with doxter field #51

Open
piotrpog opened this issue Mar 2, 2023 · 2 comments
Open

Performance issues with doxter field #51

piotrpog opened this issue Mar 2, 2023 · 2 comments

Comments

@piotrpog
Copy link

piotrpog commented Mar 2, 2023

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

@engram-design
Copy link
Member

engram-design commented Mar 3, 2023

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?

@bencroker
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants