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
Long delay when saving a post #6696
Long delay when saving a post #6696
Comments
The user in 7651806-zen appears to be running into this issue. They noted they've used the app for years but only began to run into issues around mid-January. I'm not certain why this would be, as their posts prior to January were also media-heavy, but potentially related to poorer WiFi connection while travelling. |
As far as I investigated, the issue seems related to the block processors executed for each media associated to the post when saving (reference 1, reference 2). I haven't narrowed down yet if the culprit is a specific preprocessor, I'll share more details after finishing the investigations. |
Block processing benchmarkI benchmarked the function Media Item 1:
Media Item 2:
... Media Item 18:
Total duration of processing media (18 media items): 3.128310333 seconds As you can see, each media item takes around 175 ms to be processed. This is a very long duration, especially considering that posts might have several media items. The total time is above 3 seconds, which is aligned with the issue shared. Delay estimationsOne of the main problems is that the duration grows linearly, the more media items the longer the delay. Here's an estimation of the delay in saving post durations based on the number of media items:
A delay of one second is high but may be unnoticeable by users. However, beyond that value, I think the experience is subpar. Potential solutionI profiled the editor using Xcode instruments and confirmed that the delay is caused by using That said, I propose using an HTML parser like |
Similar issue: WordPress/gutenberg#55386
Describe the bug
When saving a post, both when closing the editor and tapping on the Update button, it makes the app freeze for several seconds until it responds and saves the post. Seems it only happens depending on the post content, as far as I tested, the more images uploaded to the post the slowest it goes. After testing with multiple devices, I noticed that the delay can only be reproduced in the device that uploaded the images. If I open the same post on another device, the delay is not experienced.
To Reproduce
Expected behavior
The editor should save the post and close the editor quickly.
Screenshots
ios-delay-saving-post-with-uploads.MP4
ios-delay-saving-post-with-uploads-other-device.mov
Smartphone (please complete the following information):
Additional context
Seems it's not a regression as I managed to reproduce this issue in older versions:
The text was updated successfully, but these errors were encountered: