question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Benchmarking gradients + possible memory leak(?)

See original GitHub issue

I’ve been interested in seeing whether react-native-skia supersedes react-native-linear-gradient and created a simple app to verify the performance characteristics of both.

My experimentation seems to have uncovered that react-native-skia keeps increasing the app’s memory usage and doesn’t seem to release it.

The conclusion indicates that react-native-linear-gradient is much more performant for this use case, with skia also having a weird artifact where views appear one at a time.

This is react-native-linear-gradient with 1000 views rendered. https://user-images.githubusercontent.com/697707/175272980-5406e356-198e-45a7-a840-ab7b9c72c44c.mp4

This is react-native-skia with 1000 views rendered. (notice how memory increases) https://user-images.githubusercontent.com/697707/175274506-234d670f-c88c-4f1c-a360-691df52514d2.mp4

The code is available here: https://github.com/andreialecu/rn-perf-gradients

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
wcandilloncommented, Jun 23, 2022

We believe to have fixed the issue, I will send you a test package and maybe you can confirm it?

0reactions
wcandilloncommented, Jun 24, 2022

@andreialecu Thank you for bringing this to our attention in such a compelling example. I am closing this issue was it’s mentioning two things that we are tracking separately:

  • #628 for the memory leak
  • #610 for the slow startup time

But please feel free to reopen if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Benchmarks, Performance Optimizations, and Memory Leaks
This presentation may contain forward-looking statements that are based on our current expectations. Forward looking statements.
Read more >
Optimize PyTorch Performance for Speed and Memory ...
Set the batch size as the multiples of 8 and maximize GPU memory usage ... gradients as None, and larger effective batch sizemodel.train()...
Read more >
Working with FuncTorch: An Introduction - Wandb
This can enable us to create optimizers easily as a function of the weights and gradients. Note that PyTorch is missing a "functional...
Read more >
Frequently Asked Questions — PyTorch 1.13 documentation
My model reports “cuda runtime error(2): out of memory” ... By default, computations involving variables that require gradients will keep history.
Read more >
Mysterious Direct2D Memory Leak with gradients
The error was in my creation of the gradient stop collection: ConvertStops() yields a SharpDX.Direct2D1.GradientStopCollection .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found