-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fix Performance issue for long videos. #217
base: master
Are you sure you want to change the base?
Conversation
…to improve performance for longer videos.
Thanks soo much for looking into this @aneesijaz ! Trying out this PR, here's a few things I noticed, testing with a 2 hour video Local storageNot necessary related to your PR, but in the demo app in storybook, while testing saving changes to local storage causes problems So I commented out line 10, as this can be addressed as separate issue, more to do with how the parent application deals with the data etc.. // localStorage.setItem(`draftJs-${ mediaUrlName }`, JSON.stringify(data)); ShakingThis doesn't happen all the time, but some time, while playing the text starts to shake Typing while playingIf I start typing while it's playing, there's a delay before the text shows up. And then it gets unresponsive for a bit afterwards, did you come across this as well? |
ok so the other problem of storage exceeds is not related to this of course. |
And the issue that the editor hangs is I guess also not related to this. Because I had same experience with the visibility sensor and without the visibility sensor they both worked the same (some time's a little bit lag...) |
Thanks for the changes @aneesijaz yeah, the point of issue #150 was to see if things like visibility sensor could remove the lag. As well as trying to narrow down what's causing it. |
the lag for what the issue was a huge one.. and that was because the draftjs rendered block have a huge dom tree which cause memory to overload when all the transcript is loaded at the same time. |
Awesome, thanks, yes I haven't tried after the last commit, will try and let you know as soon as I get a chance |
Hi @aneesijaz, thanks for the PR! I just tried it locally and ran into an issue. When Scroll Sync is turned on from the options, and say you click to further in the media via the progress bar, it will give you this. Digging into the code it's because we use the querySelector to grab the word right word - but it won't find it in the DOM. As below, I wrapped an
I'm sure there's a way with react-visibility-sensor but haven't been able to dig through the library yet. Any thoughts? |
On a sidenote: in the WrapperBlock I changed "Loading" to a simple "..." And added an
I found this gives you a buffer zone of about 2 screens-worth of height (~600px for the editor)! |
I will look into that scroll sync , may be we can find any other method of doing that scroll. (I was thinking of adding those attributes of timings in the loading div and then when that the page is scrolled then the loading should be automatically converted back to the wrapper object.)
Sent from Mailspring (https://link.getmailspring.com/link/[email protected]/0?redirect=https%3A%2F%2Fgetmailspring.com%2F&recipient=cmVwbHkrQUZVWTNHVVk1REpWRUZINVBVWDNFSE40R1JUSEpFVkJOSEhDQTRZQ0dZQHJlcGx5LmdpdGh1Yi5jb20%3D), the best free email app for work
…On Jan 21 2020, at 10:25 pm, James Dooley ***@***.***> wrote:
On a sidenote: in the WrapperBlock I changed "Loading" to a simple "..."
And added an offset in the props of the visibility sensor:
<VisibilitySensor
onChange={ this.visibilityChanged }
containment={ containmentDOMRect }
offset={ { top: -1200, bottom: -1200 } }
partialVisibility
scrollCheck
>
I found this gives you a buffer zone of about 2 screens-worth of height (~600px for the editor)!
This means when scrolling fast through the editor, you don't see so much loading of the blocks, which to me is quite jarring.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub ***@***.***/1?redirect=https%3A%2F%2Fgithub.com%2Fbbc%2Freact-transcript-editor%2Fpull%2F217%3Femail_source%3Dnotifications%26email_token%3DAFUY3GRCGDAQAINRBUATCW3Q64VXJA5CNFSM4KB5ED72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJQRVTI%23issuecomment-576789197&recipient=cmVwbHkrQUZVWTNHVVk1REpWRUZINVBVWDNFSE40R1JUSEpFVkJOSEhDQTRZQ0dZQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe ***@***.***/2?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFUY3GQPUKVANVPNFDXLOHTQ64VXJANCNFSM4KB5ED7Q&recipient=cmVwbHkrQUZVWTNHVVk1REpWRUZINVBVWDNFSE40R1JUSEpFVkJOSEhDQTRZQ0dZQHJlcGx5LmdpdGh1Yi5jb20%3D).
|
Wow - would love to have this PR merged! Any blockers still? I'm finding a pretty sizable perf hit even starting around 25 mins. Does the input stt type make any difference? |
Hi @pbirsinger The input stt type should not make a difference as they all get converted to draftJs json. But yeah, help wanted in figuring out what is the exact cause of the performance issue. |
Hi @pietrop - thanks for the fast response. Do you think this PR provides any perf gain now but is buggy, or just does not significantly improve performance? |
When I last tried it, it didn't provide any significant improvement eg with a 2 hour video. But it was a while back, you are welcome to test it out locally, and do a giff/screen recording if you want to try it out |
Just tried it out, and still extremely laggy on longer videos. |
Is your Pull Request request related to another issue in this repository ?
ISSUE: Performance hit for media over 1 hour #150
Describe what the PR does
Added react-visibility-sensor and modified wrapperBlock.js file to load only the visible area which can be helpful for the long videos with long transcript.
State whether the PR is ready for review or whether it needs extra work
Ready
Additional context
This is my 1st PR so please let me know if I did anything wrong and I will amend my mistake.
Thanks.