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

chore(print): improve performance for data loading #2571

Merged
merged 29 commits into from
Apr 10, 2022

Conversation

usu
Copy link
Member

@usu usu commented Apr 4, 2022

Based on #2562, review only the new commits: https://github.com/ecamp/ecamp3/pull/2571/files/61343a10e8b066b9afbe50cc922e8c61d34d3385..69e96749c49fa629a248c0d9d1b37646a092e596

  • smarter eager data loading
  • search filter to load all contentNodes of a period
  • $contentNode->children as array of links to avoid recursive API calls

ToDo

  • fix tests

API calls now (standard print config; Harry-Potter-Lager)

http://caddy:3001/camps/05ce4b9836e9 - execution time: 851 ms

http://caddy:3001/categories?camp=%2Fcamps%2F05ce4b9836e9 - execution time: 102 ms

http://caddy:3001/activities?camp=%2Fcamps%2F05ce4b9836e9 - execution time: 257 ms

http://caddy:3001 - execution time: 65 ms

http://caddy:3001/material_lists?camp=%2Fcamps%2F05ce4b9836e9 - execution time: 85 ms

http://caddy:3001/content_types - execution time: 59 ms

http://caddy:3001/schedule_entries?period=%2Fperiods%2Fe8c03e4285cb - execution time: 204 ms

http://caddy:3001/content_nodes?period=%2Fperiods%2Fe8c03e4285cb - execution time: 379 ms

API calls before

http://caddy:3001/camps/05ce4b9836e9 - execution time: 788 ms

http://caddy:3001/schedule_entries?end%5Bafter%5D=2023-07-03T00%3A00%3A00%2B00%3A00&period=%2Fperiods%2Fe8c03e4285cb&start%5Bstrictly_before%5D=2023-07-04T00%3A00%3A00%2B00%3A00 - execution time: 118 ms

http://caddy:3001/material_lists?camp=%2Fcamps%2F05ce4b9836e9 - execution time: 82 ms

http://caddy:3001/activities/fbc7e0c7eb37 - execution time: 193 ms

http://caddy:3001/content_types/318e064ea0c9 - execution time: 73 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Feea2ceec04c6 - execution time: 102 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F0e9f487ca35a - execution time: 111 ms

http://caddy:3001/content_types/4f0c657fecef - execution time: 145 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fa6912f41f6c0 - execution time: 198 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F8b967bf8d778 - execution time: 205 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fff2ed0cab03e - execution time: 250 ms

http://caddy:3001/content_types/3ef17bd1df72 - execution time: 264 ms

http://caddy:3001/content_types/f17470519474 - execution time: 275 ms

http://caddy:3001/content_types/cfccaecd4bad - execution time: 351 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fe78589d80ab0 - execution time: 367 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Ffec746d4520a - execution time: 381 ms

http://caddy:3001/content_types/44dcc7493c65 - execution time: 420 ms

http://caddy:3001/activities/a08b26f637fd - execution time: 99 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F9718e0c98748 - execution time: 81 ms

http://caddy:3001/activities/b9690aa9d0d1 - execution time: 139 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F741f2a741eab - execution time: 92 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F2a23bb0cb8df - execution time: 114 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fa2505e2c8aca - execution time: 115 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F59f56d3c1631 - execution time: 205 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fa0166c64872c - execution time: 210 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Ff1f0bd888b9a - execution time: 223 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Ff81e2d53f972 - execution time: 289 ms

http://caddy:3001/activities/a6bd9f6c86fb - execution time: 127 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F8d4f28b35c6c - execution time: 91 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F05fd1a6276a0 - execution time: 100 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F2d95603f58df - execution time: 115 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F9e69a2d0f217 - execution time: 187 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F4b28669b41e8 - execution time: 198 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F8245d44306f4 - execution time: 209 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fa71f929dd156 - execution time: 288 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fbd796fec1ea0 - execution time: 308 ms

http://caddy:3001/activities/cce5fa2a015e - execution time: 125 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F2a7e8f49341b - execution time: 96 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F56e5c055ff76 - execution time: 115 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F90aee6918863 - execution time: 121 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fd62d16c6afb6 - execution time: 174 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F681d9e648543 - execution time: 202 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F283a58df7d9b - execution time: 223 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F2210bc67a4ce - execution time: 244 ms

http://caddy:3001/activities/dc3324f7a88b - execution time: 108 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F8d7faccc13ce - execution time: 77 ms

http://caddy:3001/activities/27e9acadda02 - execution time: 131 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F651220bcea22 - execution time: 92 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F1fe6c624a7f9 - execution time: 104 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fa70a441e44d0 - execution time: 112 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F445fcf49e6d6 - execution time: 123 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fc7a28bcfd35f - execution time: 198 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F068370456651 - execution time: 200 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F142195e3898c - execution time: 229 ms

http://caddy:3001/activities/cf90c77076cd - execution time: 131 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F063244de52d6 - execution time: 93 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F6fa0ee230602 - execution time: 106 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F8ec651d8892c - execution time: 117 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F86f38eb0029e - execution time: 132 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F1f5be4e2f781 - execution time: 191 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F83b61af97910 - execution time: 219 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Ff6163448c705 - execution time: 221 ms

http://caddy:3001/activities/12c2ae3694cd - execution time: 169 ms

http://caddy:3001/content_types/1a0f84e322c8 - execution time: 76 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fd80961e7a617 - execution time: 122 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fb570ee7e3999 - execution time: 147 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmulti_selects%2F9b8e168ed0f6 - execution time: 156 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fa0b6db7ca60f - execution time: 158 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fea63d22b8898 - execution time: 195 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F8a9bf9f6652a - execution time: 231 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fd4e553c7106b - execution time: 250 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F0810d1a172db - execution time: 262 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F02823e618716 - execution time: 279 ms

http://caddy:3001/activities/4ae5c4626953 - execution time: 131 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F764477318be2 - execution time: 127 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fd5a09b34bbe7 - execution time: 129 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fed8d97dfdf29 - execution time: 156 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fa2949c251d61 - execution time: 180 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F8a794e0e8bdd - execution time: 182 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fe5618cc0b5e8 - execution time: 337 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fc6eb39db9f9c - execution time: 341 ms

http://caddy:3001/schedule_entries?end%5Bafter%5D=2023-07-04T00%3A00%3A00%2B00%3A00&period=%2Fperiods%2Fe8c03e4285cb&start%5Bstrictly_before%5D=2023-07-05T00%3A00%3A00%2B00%3A00 - execution time: 154 ms

http://caddy:3001/activities/6ce55d8ce277 - execution time: 113 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F2f4e62a5b97e - execution time: 102 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F12ecb6e0c6bc - execution time: 111 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F67dc0c0dbd5a - execution time: 124 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F1dc712f27811 - execution time: 145 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fcd89a68084ff - execution time: 153 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F36a26e7f545e - execution time: 209 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F5f33da2c3f83 - execution time: 218 ms

http://caddy:3001/activities/1f6fe9849b0f - execution time: 93 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fc8e4a0be93af - execution time: 83 ms

http://caddy:3001/activities/8f1126e31ddb - execution time: 147 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmulti_selects%2Ff205ea34b059 - execution time: 96 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fea49fbe4a79b - execution time: 133 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F886f1428cadd - execution time: 146 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F718834024a14 - execution time: 157 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F645000130f8c - execution time: 186 ms

http://caddy:3001/activities/a64086cadc96 - execution time: 125 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F9e734d837c16 - execution time: 113 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F83c806859aa1 - execution time: 120 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fc698a03fbf87 - execution time: 125 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Faf6d3bd31bfb - execution time: 133 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fd31385bd8cab - execution time: 137 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fe4ffb5d84c4e - execution time: 209 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fe9b8601f2ff6 - execution time: 218 ms

http://caddy:3001/activities/e8ec39cfdc53 - execution time: 103 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fd3b0c2d25c72 - execution time: 78 ms

http://caddy:3001/activities/8692e4ae6c37 - execution time: 126 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fb0db3093d60e - execution time: 98 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Ffd621d723248 - execution time: 111 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F1380618e31e7 - execution time: 132 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F6c0e4b006607 - execution time: 140 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fa47e986e9179 - execution time: 151 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F69a1c2680b2b - execution time: 205 ms

http://caddy:3001/activities/05a34df11f79 - execution time: 152 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F6843404033c2 - execution time: 93 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F38318996199a - execution time: 105 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F48f7bc420ed6 - execution time: 118 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fdc940ff1826a - execution time: 130 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F09f45cf4b450 - execution time: 194 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmulti_selects%2F9b72b139d082 - execution time: 223 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F5b9566186621 - execution time: 234 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fe9c6cb975605 - execution time: 236 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F25aa0c832b70 - execution time: 298 ms

http://caddy:3001/activities/a668e4f6deb0 - execution time: 132 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F9b7eb54688e6 - execution time: 92 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F075967d2dd93 - execution time: 105 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F6f71f73439cf - execution time: 113 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F07035efc81f8 - execution time: 126 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F4ec683b8ebf6 - execution time: 193 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F32e70cad4ec9 - execution time: 208 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F77fe44df2707 - execution time: 224 ms

http://caddy:3001/activities/3f74dc9975a2 - execution time: 139 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fca5553bd6bd7 - execution time: 101 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Ff71ace6060ae - execution time: 139 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F0b25b55fbbfa - execution time: 142 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F3bb4727924f2 - execution time: 152 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F303e8d9d2e2e - execution time: 168 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Ff65d5c56cc9e - execution time: 211 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fc14691d42394 - execution time: 239 ms

http://caddy:3001/activities/cbcc7c441c8a - execution time: 164 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F473e0175effb - execution time: 97 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F8ba0295b8ea8 - execution time: 107 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmulti_selects%2Fe789b6f53771 - execution time: 120 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F60f7a48c4466 - execution time: 138 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F20471f8a92dd - execution time: 144 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F14e638398f4f - execution time: 201 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F4ab7b088344c - execution time: 234 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F1f1f866f0cbb - execution time: 246 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F160930523ce2 - execution time: 254 ms

http://caddy:3001/activities/3fd88d20fe9b - execution time: 114 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F678166f5bd6c - execution time: 82 ms

http://caddy:3001/activities/5809bfd12a91 - execution time: 143 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F8f568b5563a6 - execution time: 109 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fbdea4e3ff0c2 - execution time: 146 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F8189c8195acf - execution time: 157 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F93c08ce48916 - execution time: 160 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F99ec103f21e4 - execution time: 186 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F3d211da36cc6 - execution time: 242 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F05b712aff209 - execution time: 244 ms

http://caddy:3001/activities/8e36ab75bcf3 - execution time: 136 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fdce6bdbe1985 - execution time: 91 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F656295313d5c - execution time: 131 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F70932aca7d32 - execution time: 140 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fea0f65060295 - execution time: 148 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F81dda09111d5 - execution time: 149 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fa27e7d981943 - execution time: 189 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F2d258a7776ca - execution time: 220 ms

http://caddy:3001/activities/082242275a00 - execution time: 146 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fbee784c32dff - execution time: 103 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fe37eb1a06e03 - execution time: 125 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Faf6d5af59785 - execution time: 126 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F64959421f614 - execution time: 141 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fa29cff2d1d03 - execution time: 142 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fa06477857ced - execution time: 203 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F9c680d2e2263 - execution time: 218 ms

http://caddy:3001/activities/dee39a1a4170 - execution time: 145 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F4febc0e05ba3 - execution time: 94 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fb60d11f19ead - execution time: 106 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F66b3ea2774ec - execution time: 121 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fd1bc88c0f52e - execution time: 130 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F5bdd84d2ab79 - execution time: 208 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fdbfa40935e0d - execution time: 216 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F67be10a1b564 - execution time: 221 ms

http://caddy:3001/activities/e8991fd53177 - execution time: 140 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fce2988b91093 - execution time: 90 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F3edf02e5fd3d - execution time: 111 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fb76e3ea5d4a8 - execution time: 114 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F41463d5e6898 - execution time: 134 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F51a9f1de497a - execution time: 190 ms

http://caddy:3001/schedule_entries?end%5Bafter%5D=2023-07-05T00%3A00%3A00%2B00%3A00&period=%2Fperiods%2Fe8c03e4285cb&start%5Bstrictly_before%5D=2023-07-06T00%3A00%3A00%2B00%3A00 - execution time: 126 ms

http://caddy:3001/activities/2e8a48ca589b - execution time: 118 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fffc6af8f3159 - execution time: 94 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F05b63c397dcd - execution time: 109 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fe7978f772687 - execution time: 119 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fd245021c46fa - execution time: 131 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F2d0de0759cd4 - execution time: 198 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F954819c60f15 - execution time: 213 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F6127f9640b45 - execution time: 214 ms

http://caddy:3001/activities/4a1f81738c99 - execution time: 115 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F90bee6cb8815 - execution time: 91 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fbac6cf64fd44 - execution time: 106 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fefaafb64e04c - execution time: 114 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F70b8420479aa - execution time: 128 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2Fe0113df37985 - execution time: 147 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fe44cf76f839d - execution time: 207 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fe2ba5d9578b7 - execution time: 209 ms

http://caddy:3001/activities/fd44afa1f37e - execution time: 116 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F6c21b66b59f8 - execution time: 98 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Ff04b6a1372cc - execution time: 117 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fbaeb0218568b - execution time: 126 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F7cb2752737e2 - execution time: 138 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fca9582689c1e - execution time: 145 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2Fd2187a3531af - execution time: 196 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F805227053131 - execution time: 210 ms

http://caddy:3001/schedule_entries?end%5Bafter%5D=2023-07-06T00%3A00%3A00%2B00%3A00&period=%2Fperiods%2Fe8c03e4285cb&start%5Bstrictly_before%5D=2023-07-07T00%3A00%3A00%2B00%3A00 - execution time: 85 ms

http://caddy:3001/activities/7341faac0de7 - execution time: 111 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F9ffb2b512f1e - execution time: 99 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fmaterial_nodes%2F7d66dde6d514 - execution time: 109 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2Fd63973e52b25 - execution time: 139 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2Fa7c05f91afbc - execution time: 146 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fsingle_texts%2F27e942280410 - execution time: 199 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fcolumn_layouts%2F50172d027864 - execution time: 226 ms

http://caddy:3001/content_nodes?parent=%2Fcontent_node%2Fstoryboards%2F0b625c957d44 - execution time: 234 ms

@usu usu marked this pull request as ready for review April 5, 2022 08:57
@usu usu requested review from carlobeltrame and BacLuc April 5, 2022 16:00
@@ -41,7 +42,8 @@
denormalizationContext: ['groups' => ['write']],
normalizationContext: ['groups' => ['read']],
)]
#[ApiFilter(SearchFilter::class, properties: ['parent', 'contentType', 'root'])]
#[ApiFilter(SearchFilter::class, properties: ['contentType', 'root'])]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the parent filter? Are you sure that it wasn't used anywhere? I can't remember, but there were a lot of tests for this which you had to remove.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the parent filter results in children property to not be a single link but an array of links (basically disabling RelatedCollectionLinkNormalizer). This avoids a lot of above API Calls, because once I have the complete list of ContentNodes I can freely traverse down the child nodes without additional API calls.

hal-json-vuex is now "immune" to this, because it will just create a virtual key for the children array.

It shouldn't break anything. Just notice that in the frontend, we're actually no using the children property at the moment, because we do the filtering manually:
https://github.com/ecamp/ecamp3/blob/devel/frontend/src/components/activity/DraggableContentNodes.vue#L67

Copy link
Member

@carlobeltrame carlobeltrame Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now I get it. In this specific case (recursive data structure) we actually prefer the array of hrefs children: [{ href: '/content-nodes/1a2b3c4d' }, { href: '/content-nodes/1234abcd' }, ... ] over the shortened, filtered single link children: { href: '/content-nodes?parent=/content-nodes/00000000' }, because we don't want to embed all children, and because the array contains all the information we need for filtering in the frontend, without sending a separate request for /content-nodes?parent=/content-nodes/00000000

When I wrote the RelatedCollectionLinkNormalizer, I did not foresee that the link array could ever be more useful than the single filtered link. Maybe we don't need the parent filter right now. But I think we should introduce a way to explicitly disable the filtered link even when the filter exists. Otherwise, someone might in the future e.g. add filters for all relations, and make the performance worse without noticing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Explicitly comment in tests why children needs to be an array (to avoid someone adding the parent filter again in the future)

@@ -24,7 +24,7 @@
#[ApiResource(
collectionOperations: [
'get' => [
'normalization_context' => ['groups' => ['read', 'Activity:ActivityResponsibles', 'Activity:ContentNodes']],
'normalization_context' => ['groups' => ['read', 'Activity:ActivityResponsibles']],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added to make the react-print load time bearable during development. So we should soon add similar replacements for this to react-print as you did for nuxt-print.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, absolutely. I suggest we merge this first, and then we can use the same data loading concept for react-print (by me or you - both ok for me).

@usu usu merged commit 2a260b0 into ecamp:devel Apr 10, 2022
carlobeltrame added a commit to carlobeltrame/ecamp3 that referenced this pull request May 4, 2022
carlobeltrame added a commit to carlobeltrame/ecamp3 that referenced this pull request May 4, 2022
carlobeltrame added a commit to carlobeltrame/ecamp3 that referenced this pull request Jul 5, 2022
carlobeltrame added a commit to carlobeltrame/ecamp3 that referenced this pull request Jul 5, 2022
@usu usu deleted the chore/print-performance branch November 6, 2022 05:52
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

Successfully merging this pull request may close these issues.

3 participants