I have pretty big View which returns hundreds of rows and I am struggling with View render time. Stats are as follow:
Query build time: 44.69 ms
Query execution time: 111.52 ms
View render time: 6978.68 ms
Problem is this view differs from user to user so caching is not effective. It gets build for the first time user visits the website and this takes 7 seconds, then it runs smoothly. But if anything changes in this table, whole cache gets invalidated for all the users and they again wait 7 seconds to render the website.
I tried direct queries in hook_preprocess_views_view_field
where I tried either fetching values with NID with entityTypeManager() in hopes of bypassing whatever is happening in the background or direct queries to database and tables but this was no faster.
My guess is there is so much stuff going on for EACH of the row / field in terms of build-in hooks, event subscribers, theme files etc. which I have no control over that together they make up the majority of views render time.
How can I speed up a View like that?