2

I'm wondering what kind of performance I should expect from Craft 3's Control Panel.

I've created a (clever) structure, where I have matrix field which contains a superTable field.

  • Matrix
    • Row (block type)
      • Column (superTable)
        • Style (dropdown)
        • Image (an asset)
        • Text (redactor)

The idea being that I can add rows, and inside the rows I can add a number of columns and fill the column with an image and/or text. From this I create a bootstrap grid.

Problem is that editing entries get really slow if and when the entry has larger amount of rows and columns. On the worst page I have 24 rows and loading the page makes 362 db queries and takes well over 10 seconds to load all redactor fields. This is way too slow to be usable.

Control Panel debugger

Chrome debugger

Then I started again from an empty page, which has fields for:

  • title
  • categories
  • hero image
  • ingress/description
  • and a button to add rows

An empty page creates 116 db queries. Every time I add a new row it adds 9 db queries. Every new column adds 3 db queries. So 10 new rows would create at least 90 new db queries, which is beginning to be problematic.

So is this the amount of db queries that I should expect, ie. is this normal? Is there something fundamentally wrong in the way I created the fields for the page using matrix and a superTable? What can I do to improve the performance?

(Running Craft 3.0.10.2 on Windows/IIS and MariaDB)

1
  • The amount of queries is normal. That's how these things work but I really doubt this is the critical point. You should take a look at your debug toolbar I expect the occurs on the client's side so the Javascript takes too long to initialize all the redactors Commented Jun 8, 2018 at 11:28

1 Answer 1

3

Is this a problem with only the dashboard, or the front-end also? Although this is a bad answer, waiting a few seconds to load the dashboard shouldn't be a huge deal. You will only need to access it a few times while editing content. On the other hand, there are ways to improve the front-end performance such as Eager Loading.

You can approach this conceptually by creating a simpler data model. In my opinion, super table inside of a matrix is a sign that you are doing something wrong. There is a reason that matrix in matrix is not supported, probably because of this performance issues like this.

You can also extend the dashboard or something to implement eager loading or cut down on db queries but I don't think it is worth the effort. Maybe you can mention something to Pixel and Tonic and they will improve this in a later version of craft.

7
  • Problem is only in the dashboard. I agree waiting a few seconds would not be a problem, but waiting 12-13 seconds for the browser to become responsive is too much.
    – LosHosez
    Commented Jun 7, 2018 at 17:02
  • Then you might need to rethink how you are entering data. Especially since redactor is very powerful by itself. Commented Jun 7, 2018 at 17:23
  • The problem is that creating a grid-like layout requires having two level system that Craft cannot do, which makes plugins like superTable really useful. How else would you add a container row, and a number of columns in to the row, if not by using matrix in matrix?
    – LosHosez
    Commented Jun 7, 2018 at 17:57
  • allowing the full range of columns might be over kill. most websites will work with a full width, halves and third columns. I guess craft isn't really designed to work like this. You could give each block a width dropdown with 1-12 to specify num columns. Commented Jun 7, 2018 at 18:07
  • 1
    Unfortunately computers have a finite amount of resources. You can't throw a super complex matrix layout with embedded reactor fields (maybe 20-30 from what I can tell) and expect people's computers to be performant. This is not a craft problem, you are structuring the website wrong. Commented Jun 8, 2018 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.