Skip to content

Optimize formatter with hot cache #8135

@konstin

Description

@konstin

There's a lot of optimization opportunities with the formatter with a hot cache (the example is apache airflow with rayon removed):

  • Sorting the result takes a long time so does building the result vec, even though we know its approximate size
  • Don't read source files in formatter when there is a cache hit #8132
  • Deserializing the cache takes noticeable time even if we just need 4k paths plus timestamps
  • We first iterate over each directory only to check the timestamps later, could those be combined?

image

Instructions for generating the flamegraph:

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterRelated to the formatter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions