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

Report slowest frames #1381

Merged
merged 15 commits into from Oct 10, 2022
Merged

Report slowest frames #1381

merged 15 commits into from Oct 10, 2022

Conversation

uragirii
Copy link
Contributor

@uragirii uragirii commented Oct 7, 2022

Fixes #1344

renderMedia returns array of 10 slowest frames with frame indexes for user to optimise them.

Tasks:

  • Report in cli in verbose mode
  • Log slowest frames in lambda
  • Update docs
  • CI build pass (or fix tests)?

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@vercel
Copy link

vercel bot commented Oct 7, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
remotion ✅ Ready (Inspect) Visit Preview Oct 10, 2022 at 6:33PM (UTC)

@uragirii
Copy link
Contributor Author

uragirii commented Oct 8, 2022

Screenshot 2022-10-08 at 8 13 14 PM

@JonnyBurger idk if its a configuration error? or older node version

@JonnyBurger
Copy link
Member

@uragirii Array.at cannot be used because it is not supported in Node.JS. We need to use normal array[i] notation for now

@uragirii uragirii changed the title wip Report slowest frames Report slowest frames Oct 9, 2022
@uragirii uragirii marked this pull request as ready for review October 9, 2022 20:31
@uragirii
Copy link
Contributor Author

uragirii commented Oct 9, 2022

@JonnyBurger should be ready for review

Copy link
Member

@JonnyBurger JonnyBurger left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Looks mostly good!
I realized that renderMedia() already has a return type and this would be a breaking change.

Therefore I had to change the API to be a callback in order to not break the function signature. We can refactor this in Remotion v4.

Only problem I see:
When rendering using pnpm exec remotion render src/index.tsx react-svg --log=verbose in packages/example, in about 20-30% of the cases, the frames are out of order:

Screenshot 2022-10-10 at 15 16 17

This is the last blocker before I can merge this.

@uragirii
Copy link
Contributor Author

@JonnyBurger now it should be fixed. Also, there is a small "bug", the first concurrent number of frames would always be in the slowest frames as they also include the time of opening chrome tabs. We could get "actual" concurrency value and omit them, what do you think?

@JonnyBurger
Copy link
Member

@uragirii Thanks!

I have noticed another bug: The timing is since the last frame was rendered, but since multiple frames are rendered in parallel, that does not reflect the time it has taken to render a frame. Fixed now!

Regarding the first frame of a tab being slower, I think let's embrace it! It's useful to see the initialization time. This looks insightful to me:

image

Copy link
Member

@JonnyBurger JonnyBurger left a comment

Choose a reason for hiding this comment

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

And with that, fully happy 🎉

Thanks a lot for building this feature! How long did you approximately spend on this PR?

@JonnyBurger JonnyBurger merged commit 6dd2be7 into remotion-dev:main Oct 10, 2022
@uragirii
Copy link
Contributor Author

uragirii commented Oct 10, 2022

The timing is since the last frame was rendered, but since multiple frames are rendered in parallel, that does not reflect the time it has taken to render a frame.

Ahh didn't thought of that! Great!

How long did you approximately spend on this PR?

1-1.5 hour

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.

Report slowest frames of renderMedia()
2 participants