Skip to content

Performance: segment blocks the main thread #56

@zallarak

Description

@zallarak

Segment seems to block the main thread for 300+ ms

image

We are using async tags though. Any ideas?


  // Segment
  renderSegmentSnippet() {
    const opts = {
      apiKey: env.SEGMENT_WRITE_KEY,
      page: true,
    };
    if (process.env.NODE_ENV === "development") {
      return snippet.max(opts);
    }
    return snippet.min(opts);
  }

...
          {/* Segment */}
          <script
            async
            dangerouslySetInnerHTML={{ __html: this.renderSegmentSnippet() }}
          />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions