Building text animations for Instagram Stories
Instagram's 2020 Stories text styles and animations required solving cross-platform font delivery and Unicode-aware rendering. On Android, bundling 4.5 MB of fonts would have cost an estimated 700K installs a month, and Google's Downloadable Fonts lacked some needed fonts, so the team built a generic font repository on Everstore, their Haystack-based blob store. A month-long crash hunt during A/B testing eventually traced to that trusted caching infrastructure failing to clean up files. Character-by-character reveals had to handle ligatures, emoji, RTL text and custom spans, which led the team to drop per-character Canvas#drawText for cached StaticLayouts, while iOS word reveals used NSLinguisticTagger for language-aware tokenization.
Related posts
- Language packs: Meta’s mobile localization solution
Meta Engineering mediumAdeptMeta delivers mobile translations as download-on-demand language packs: per-locale binary hash maps keyed by hashed string IDs, holding nested lookup tables that resolve gender and plural variations at runtime through its FBT string API. Packs are built and uploaded to cloud storage per release, then loaded from disk or downloaded during asynchronous startup, with prefetch before new versions and fallback to stale packs for poor networks. Removing bundled translations cut the Facebook iOS IPA by 16.6 MB, and packs run 600KB–2MB. Loads succeed over 99.99% of the time on iOS (~80ms from disk) and over 99.7% on Android (~780ms). Bundled packs remain preferable for apps with few strings or tight startup budgets.
- Steganography at scale: Embedding share URLs in Datadog widget screenshots
Datadog Engineering mediumAdeptDatadog embeds an 8-byte snapshot ID invisibly into the 1 px border of every dashboard widget so screenshots can be resolved back to the full widget context (queries, time range, template variables), with definitions cached in Redis for one hour keyed by org ID plus widget ID. A first scheme packing a byte per pixel via RGB offsets broke under display color-profile conversion (e.g., DCI-P3 shifting channels by ±1) and was sometimes visible. The final design uses fuzzy encoding: ±3 offsets on red and green carry 2 bits per pixel, decoded within tolerance ranges, with blue-shifted sentinel pixels marking a 34-pixel watermark. The system also handles device pixel ratios and copy-paste workflows, and renders over a billion watermarks per day with an estimated ~1 in 37 million collision probability.
- Reducing Android scope-sync overhead in Sentry Flutter
Sentry mediumAdeptSentry's Flutter SDK cut Android scope-update processing time by 27–30% by removing duplicate normalization and encoding JSON directly to UTF-8 bytes. Scope data was being normalized on both the calling isolate and the worker isolate, so normalizing once halved that step (e.g. 2.71 ms to 1.35 ms for 238 KB). Replacing jsonEncode plus utf8.encode plus a Uint8List copy with JsonUtf8Encoder saved 16% of encoding time, while removing the buffer copy alone saved only about 2%. Pixel 4 benchmarks show savings of about 11 µs per small breadcrumb and 2.29 ms for 238 KB payloads, and the changes ship in sentry_flutter 9.26.0.
- The Sentry Android SDK is now 20-30% faster!
Sentry mediumAdeptSentry's Android SDK init time dropped 20-30% between versions 8.43.0 and 8.54.0, alongside reduced memory allocation, fixed leaks and up to 10% less background CPU. The team found bottlenecks with Perfetto traces and validated over 40 changes with Android Macrobenchmark on a clock-locked Pixel 3. Highlighted changes: the Gradle plugin writes manifest options and class-availability checks into bytecode at build time, avoiding manifest parsing and reflection (6.5% gain); a custom DSN parser replaces java.net.URI (6ms down to 1µs); and one-off threads move to shared executor pools, saving 3MB of heap from ART's 1MB thread stacks. Upgrading to SDK 8.54.0+ and Gradle plugin 6.20.0+ is enough to get the gains.
- Lessons From Building Android Widgets
Shopify Engineering mediumAdeptShopify built its Android analytics widgets natively rather than in React Native, because widgets must be built from RemoteViews, which React Native does not support. Widget onUpdate() fires several times per cycle, so a one-minute cache keyed by widget ID removes redundant network calls and incorrect analytics. RemoteViews also append to existing views on each update, which they fixed by calling removeAllViews() before addView(). Charts are drawn from MPAndroidChart as ARGB_8888 bitmaps, relative timestamps were dropped over battery cost, and update flicker is reduced by suppressing updates for 60 seconds after placement and rendering early from cached shared preferences.