Skip to content

Optionally skip metadata generation for JSON/Yaml parsers #700

@marcelofabri

Description

@marcelofabri

When profiling parsing JSONs (Lottie animations), I've noticed that most of the time is spent generating the metadata field, although my template doesn't use it at all.

By commenting this line, I was able to improve the duration from ~750ms (using JSONSerialization, see #698) to ~100ms.

Since figuring out whether we need to parse it or not based on the template would be tricky, I propose that we add a key to ConfigEntryOutput named includeMetadata that will be true by default.

The configuration file would look like this:

json:
  inputs:
    - Assets/Lottie/
  outputs:
    - templatePath: templates/lottie.stencil
      output: Generated/Lottie.swift
      includeMetadata: false # or should it be `skipMetadata` instead?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions