Javis.jl icon indicating copy to clipboard operation
Javis.jl copied to clipboard

Benchmarks; Improve performance

Open Sov-trotter opened this issue 4 years ago • 3 comments

We have been constantly adding lots of features to base javis and I think now is the right time to measure their performance impact.

A good way to start would be

  • comparing rendering times for scripts with no_layers - before and after merging layers.
  • Precompilation times after introducing shorthands.

This issue also covers future performance improvements. Precompile times : Ref: https://discourse.julialang.org/t/22-seconds-to-3-and-now-more-lets-fix-all-of-the-differentialequations-jl-universe-compile-times/66313

Internally, I think speeding up rendering is the only major thing, which in itself includes three parts:

  • Rendering of objects
  • Computations for Actions
  • Layers(rendering, actions, layer caches)
  • Misc. Image matrices etc.

IMO all of these can use individual Profiling. https://www.youtube.com/watch?v=wXRMwJdEjX4

Sov-trotter avatar Aug 13 '21 08:08 Sov-trotter

Yeah I think it would be great to have some test animations with profiling and getting a good overview of the parts that take the most time and share it here.

Wikunia avatar Aug 14 '21 15:08 Wikunia

Example inverse kinematics

https://gist.github.com/Wikunia/febbb3b40071d5273d5fa4b0bc1dde6d

Profiling that without rendering to a gif/mp4 gives ~50% time spend in get_javis_frame

  • ~ 6% in image_as_matrix
  • ~ 40% drawing circles :smile:

~ 43% save images

But with rendering it to a gif ~50% is doing all of the above and the other 50% on rendering which seems quite a lot

Wikunia avatar Sep 12 '21 18:09 Wikunia

Example Layers Tutorial

See: https://github.com/Wikunia/Javis.jl/pull/414

Without rendering as well: ~ 80% in get_javis_frame

  • ~20% in get_layer_frame
  • ~50% in place_layers

~16% in save

With gif: Same as above but with 14% rendering time of overall time.

In general seems like there isn't much we can do with Javis itself while keeping the same structure for @JLayer and placing images is quite expensive.

Wikunia avatar Sep 12 '21 18:09 Wikunia