---
title: "How we brought Datadog’s data visualization to iOS: A focus on performance"
description: "Datadog built DogGraphs, an internal SwiftUI graphing library constrained to iOS 14 (no Canvas), with a result-builder API that type-checks graph compositions at compile time."
url: "https://swe.quest/articles/how-we-brought-datadog-s-data-visualization-to-ios-a-focus-on-performance-32d8e749b08067ee"
canonical: "https://www.datadoghq.com/blog/engineering/how-we-brought-datadog-data-visualization-to-ios-performance/"
source: "Datadog Engineering"
published: "2024-04-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 15
tags: ["swift","mobile","performance","frontend"]
---

# How we brought Datadog’s data visualization to iOS: A focus on performance

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2024-04-18, 15 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/how-we-brought-datadog-data-visualization-to-ios-performance/](https://www.datadoghq.com/blog/engineering/how-we-brought-datadog-data-visualization-to-ios-performance/)

## Summary

Datadog built DogGraphs, an internal SwiftUI graphing library constrained to iOS 14 (no Canvas), with a result-builder API that type-checks graph compositions at compile time. Profiling with \_printChanges() and Xcode Instruments showed that layers observing a shared EnvironmentObject coordinate system caused twice the expected body evaluations (339 vs 113 for a 113-line chart). Moving coordinate-system reduction into the @resultBuilder via TupleGraphContent fixed that. For charts with thousands of bars, a Batch content type groups shapes by fill and stroke style and draws each group as a single Path, which removes the rendering hangs. The post also explains SwiftUI's diffing order: memcmp for POD views, then Equatable, then reflection.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Swift](https://swe.quest/tags/swift.md) (Languages)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- SwiftUI view basics
- Swift result builders ([easy posts on Swift](https://swe.quest/tags/swift.md?difficulty=easy))
- Xcode Instruments

## Keywords

SwiftUI, DogGraphs, Xcode Instruments, resultBuilder, iOS 14

## Related posts

- [Lessons From Building iOS Widgets](https://swe.quest/articles/lessons-from-building-ios-widgets-87bd1407ab4fa628.md): Shopify Engineering · 2022-09-22 · Medium · 23 min read · Mobile, Swift, Caching, Product engineering
  Shopify rebuilt its iOS analytics widgets natively in SwiftUI rather than React Native, because app extensions have tight memory limits, WidgetKit serializes SwiftUI view hierarchies, and React Native had no official widget support.
- [Challenges of mixed SwiftUI and UIKit codebases in iOS Apps](https://swe.quest/articles/challenges-of-mixed-swiftui-and-uikit-codebases-in-ios-apps-2b630ad5ea3f4d4c.md): Medium Engineering · 2024-07-01 · Medium · 4 min read · Mobile, Swift, Refactoring & migrations
  Mixing SwiftUI into Medium's 2013-era UIKit iOS app brings recurring friction: sizing SwiftUI views hosted in UIHostingController as table/collection cells, mismatched scroll APIs (offset sign differs), and duplicated components like PostPreview implemented in both frameworks.
- [DRUIDS, the design system that powers Datadog](https://swe.quest/articles/druids-the-design-system-that-powers-datadog-7348e64421a4e6f1.md): Datadog Engineering · 2022-09-29 · Easy · 7 min read · Design systems, Frontend, React, Developer productivity, Documentation
  DRUIDS (Datadog Reusable User Interface Design System) was started in 2018 to keep UX patterns consistent as Datadog grew into dozens of products, and its docs site is now public.
- [Swift at scale: building the TelemetryDeck analytics service](https://swe.quest/articles/swift-at-scale-building-the-telemetrydeck-analytics-service-0f65fbef9503707f.md): Swift.org · 2026-03-06 · Medium · 7 min read · Swift, API design, Analytics & OLAP
  TelemetryDeck runs its privacy-focused app analytics service, covering over 16 million users a month, on Swift and Vapor in Kubernetes, with Postgres for metadata and Apache Druid for analytics data.
- [How we build SwiftUI features in the Medium application](https://swe.quest/articles/how-we-build-swiftui-features-in-the-medium-application-6bea0243c28426a7.md): Medium Engineering · 2021-06-08 · Medium · 9 min read · Swift, Mobile, Refactoring & migrations, Build systems, GraphQL
  Medium's iOS team builds new iOS 13+ features in SwiftUI and Combine by splitting a monolithic, partly Objective-C codebase into Swift packages: ApolloModel for generated GraphQL models, SharedUI components, per-feature UI packages, and planned LiveService/FakeService packages.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
