squidfunk / mkdocs-material

Documentation that simply works

Home Page:https://squidfunk.github.io/mkdocs-material/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable animations only of code annotations that are visible

polakowo opened this issue · comments

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

A high amount of code annotations may cause high CPU usage because of constant style recalculations and rendering. This can be mitigated by showing animations only of code annotations that are visible in the viewport.

Use Cases

Reduce CPU usage.

Screenshots / Mockups

Screen Shot 2022-05-24 at 13 06 06

Thanks for suggesting! Fixed in 5e442eb. This is actually a great optimization that was almost trivial to achieve.

Released as part of 8.2.16.