---
title: "Performance"
description: "817 posts about Performance, summarised, each linking to the original."
---

# Performance
> 817 posts about Performance, summarised, each linking to the original.

## Articles

### [Scaling Shopify's BFCM Live Map: An Apache Flink Redesign](https://yomu.fyi/post/scaling-shopify-s-bfcm-live-map-an-apache-flink-redesign.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Dec 10, 2021
- Type: Problem & solution

Shopify’s 2021 BFCM live map had to scale from more than 1.7 million merchants while adding product trends and unique shoppers, after the prior Cricket-and-Redis backend showed volume and delivery weaknesses. The redesign placed Apache Flink on the critical path to filter irrelevant checkout events, reducing Cricket’s workload to about one percent of event volume, while cross-region sharding and active-active deployment supported availability. Flink computed new metrics, including 500 product categories ranked by sales-volume change every five minutes, while Cricket retained existing metric computation and deduplication. In load tests, the pipeline handled 1 million checkout events per second, and its jobs ran at 100 percent uptime during BFCM without backpressure or manual intervention. Redis still caused high CPU and memory pressure, producing brief arc-visual errors for a small sample of users, so Shopify plans a simpler Flink-centered design.


### [Five more things](https://yomu.fyi/post/five-more-things.md)
- Company: [Supabase](https://yomu.fyi/company/supabase.md)
- Author: Ant Wilson
- Published: Dec 3, 2021
- Type: Announcement

Supabase announced a series of platform updates, technical releases, and community initiatives to conclude its Launch Week. The team open-sourced pg\_graphql, an in-progress PostgreSQL extension that keeps schema generation, query parsing, and resolvers natively on the database server. Supabase also enabled a global CDN spanning over 250 cities, delivering edge caching with a default one-hour cache time for storage assets alongside TLS 1.3, HTTP/3 over QUIC, and Brotli compression. While Supabase Functions is not yet released, two public RFCs were opened to explore architecture options, leaning heavily toward container-based execution. Finally, the update introduced a free SaaS development course with egghead.io and launched the ten-day Holiday Hackdays hackathon.


### [pg\_graphql: A GraphQL extension for PostgreSQL](https://yomu.fyi/post/pg-graphql-a-graphql-extension-for-postgresql.md)
- Company: [Supabase](https://yomu.fyi/company/supabase.md)
- Author: Oliver Rice
- Published: Dec 3, 2021
- Type: Announcement

Supabase has open-sourced pg\_graphql, a native PostgreSQL extension written in C and SQL that enables in-database GraphQL schema reflection and query resolution. Because free-tier virtual machines lacked memory headroom for standalone GraphQL processes like Hasura or Graphile, the team designed an in-engine solution to eliminate extra runtime overhead. The extension parses, validates, and transpiles incoming GraphQL operations into single SQL statements that aggregate data into JSON responses. This architecture avoids N+1 query problems, enforces existing row-level security policies, and maps GraphQL requests directly onto PostgreSQL transactions. The public SQL function can be queried directly or exposed over HTTP via PostgREST remote procedure calls.


### [Realtime Postgres RLS now available on Supabase](https://yomu.fyi/post/realtime-postgres-rls-now-available-on-supabase.md)
- Company: [Supabase](https://yomu.fyi/company/supabase.md)
- Author: Oliver Rice
- Published: Dec 1, 2021
- Type: Announcement

Supabase updated its Realtime server to enforce PostgreSQL Row Level Security (RLS) policies when broadcasting database changes over websockets. Previously, Realtime operated as an opt-in beta feature that sent all replication changes to every client regardless of user authorization. To enforce RLS per subscriber without heavy performance overhead, Supabase introduced WALRUS, a security engine colocated inside PostgreSQL. For each replication change, WALRUS looks up active subscribers, assumes their identities, and evaluates row visibility using prepared statements queried by primary key. This in-database evaluation avoids external network round trips and single-query planning overhead while returning an authorized subscriber list to Realtime.


### [Getting Started with Hugging Face Transformers for IPUs with Optimum](https://yomu.fyi/post/getting-started-with-hugging-face-transformers-for-ipus-with-optimum.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Tim Santos, Julien Simon
- Published: Nov 30, 2021
- Type: Tutorial

Transformer prediction speed can hinder latency-sensitive workloads like conversational systems and search, while optimizing hardware performance requires significant effort. Hugging Face introduced Optimum, an open-source library that reduces Transformer model latency across diverse hardware targets. Through a partnership with Graphcore, BERT is introduced as the initial IPU-optimized model for parallel AI hardware. Developers configure the Poplar SDK environment and PopTorch inside Graphcloud, install optimum-graphcore, and execute the run\_qa.py script with an IPU configuration file. Fine-tuning bert-base-uncased on SQuAD v1.1 using the IPUTrainer class yields an evaluation F1 score of 88.2757 and an exact match score of 80.6623 across 10,784 evaluation samples.


### [New in PostgreSQL 14: What every developer should know](https://yomu.fyi/post/new-in-postgresql-14-what-every-developer-should-know.md)
- Company: [Supabase](https://yomu.fyi/company/supabase.md)
- Author: Gurjeet Singh
- Published: Nov 28, 2021
- Type: Explainer

PostgreSQL 14 introduces several enhancements to improve application performance, data manipulation, query troubleshooting, and database security. Developers can traverse nested JSON data structures using subscripting and store noncontiguous values using multirange data types in single operations. Applications relying on libpq can leverage client-side query pipelining to send multiple queries across high-latency networks without waiting for individual responses, while parallel execution now supports foreign data wrappers, parallel sequential scans, and materialized view refreshes. For observability, query IDs are integrated into live execution tracking via pg\_stat\_activity, EXPLAIN VERBOSE outputs, and log files. Security upgrades include predefined read-only roles such as pg\_read\_all\_data alongside SCRAM-SHA-256 enabled as the default authentication mechanism.


### [Building an App Clip with React Native](https://yomu.fyi/post/building-an-app-clip-with-react-native.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Nov 26, 2021
- Type: Problem & solution

The Shop team built an iOS App Clip to reduce the drop-off between a buyer’s checkout thank-you page and opening the full Shop app, where App Store download and onboarding added friction. App Clips are invoked through actions such as QR scans, links, or Smart App Banners and must stay below 10MB, while the team wanted React Native support for order tracking and related functionality. A Hello World build initially measured 28MB; explicitly selecting native dependencies in the Podfile reduced the baseline to 4.3MB, and a scrappy feature build reached 6.5MB. The team used early testing, invocation URL handling through React Native Linking, and shared data containers for app upgrades, ultimately releasing an App Clip at 9.1MB; extensive code sharing proved too complex and some code was copied.


### [Using real-world patterns to improve matching in theory and practice](https://yomu.fyi/post/using-real-world-patterns-to-improve-matching-in-theory-and-practice.md)
- Company: [Grab](https://yomu.fyi/company/grab.md)
- Author: Tenindra Abeywickrama
- Published: Nov 22, 2021
- Type: Problem & solution

Continuous ride-hailing assignment relies on solving the minimum weight bipartite matching problem between passengers and driver-partners. While traditional implementations assume a precalculated cost matrix, computing shortest-path travel times across large road networks dominates total execution time. Researchers introduced an Incremental Kuhn-Munkres algorithm that leverages the spatial locality of optimal matches to compute edge costs on demand. The approach integrates priority queues and lower-bounding techniques with refinement rules to avoid evaluating distant pairs while guaranteeing the same optimal assignment. Evaluated on Singapore road network data and real Grab production workloads, the incremental techniques reduced exact cost calculations and decreased assignment running times by over an order of magnitude.


### [Accelerating PyTorch distributed fine-tuning with Intel technologies](https://yomu.fyi/post/accelerating-pytorch-distributed-fine-tuning-with-intel-technologies.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Julien Simon
- Published: Nov 19, 2021
- Type: Tutorial

Transfer learning makes CPU-based clusters a viable, cost-effective option for shorter deep learning fine-tuning jobs. To accelerate PyTorch workloads, clusters can leverage Intel Ice Lake architecture featuring AVX-512 and Vector Neural Network Instructions alongside specialized software optimizations. Implementing the Intel Extension for PyTorch and the oneAPI Collective Communications Library (oneCCL) addresses communication bottlenecks across distributed nodes. In demonstrated tests fine-tuning transformer models on GLUE tasks across Amazon EC2 c6i.16xlarge instances, two-node jobs delivered roughly a 1.7x speedup, while four-node setups achieved a 3x speedup. These performance libraries and multi-node configurations maintain consistent scaling across both smaller datasets like MRPC and larger benchmarks like QQP.


### [Using Propensity Score Matching to Uncover Shopify Capital’s Effect on Business Growth](https://yomu.fyi/post/using-propensity-score-matching-to-uncover-shopify-capital-s-effect-on.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Nov 11, 2021
- Type: Benchmark

Shopify’s data team sought to estimate whether accepting Shopify Capital for the first time increased merchants’ subsequent sales, without randomly denying funding in an A/B test. They compared US first-time adopters in January 2019 with Canadian shops that later pre-qualified for Capital, using propensity scores built from Shopify sales and performance characteristics and matching them with a caliper-based greedy nearest-neighbor algorithm. After matching about 600 treated shops against roughly 8,000 controls, they evaluated log-transformed cumulative GMV from February through July 2019 with a binary regression and checked balance using standardized mean differences, visual comparisons, and variance ratios. The estimated geometric-average GMV was 36% higher for US merchants, with a 95% confidence interval of 13% to 65%; robustness checks supported a positive treatment effect.


### [Building Blocks of High Performance Hydrogen-powered Storefronts](https://yomu.fyi/post/building-blocks-of-high-performance-hydrogen-powered-storefronts.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Nov 8, 2021
- Type: Explainer

Hydrogen is a React-based framework for custom Shopify storefronts, designed to balance fast loading, personalized and dynamic commerce, and developer experience. The central trade-off is that static generation and edge delivery can speed loading but defer personalization, while conventional server-side rendering can slow time-to-first-byte as data is fetched. Hydrogen addresses this with React 18 alpha streaming SSR powered by Suspense, which streams the page shell before data resolves and progressively hydrates components without extra client round trips. React Server Components keep server-only code out of bundles, support server-side data access, and enable component-level updates that preserve client state. Built-in fetching and configurable caching, including stale-while-revalidate, work with Oxygen’s colocated runtime, while developers can mix server rendering, client fetching, and edge delivery at page or component level.


### [The Vitality of Core Web Vitals](https://yomu.fyi/post/the-vitality-of-core-web-vitals.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Nov 4, 2021
- Type: Tutorial

Core Web Vitals were introduced by Google in 2020 as unified guidance for web UX, and their loading, interactivity, and visual stability metrics became one factor in ranking systems after rollout from mid-June through the end of August 2021. The article explains LCP, FID, and CLS, including how LCP identifies the largest visible element, FID measures delay before the browser responds to a first interaction, and CLS sums unexpected layout shifts. It gives good and poor thresholds of 2.5 seconds and 4 seconds for LCP, 100 milliseconds and 300 milliseconds for FID, and 0.1 and 0.25 for CLS, with intermediate scores needing improvement. Recommended improvements include updating dependencies and tree-shaking unused library code, preloading critical assets, improving server response time, lazy-loading below-the-fold content, compressing images, and reserving image space to prevent shifts.


### [Scaling up BERT-like model Inference on modern CPU  - Part 2](https://yomu.fyi/post/scaling-up-bert-like-model-inference-on-modern-cpu-part-2.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Ella Charlaix, Jeff Boudier, Morgan Funtowicz, Michael Benayoun
- Published: Nov 4, 2021
- Type: Problem & solution

Scaling transformer inference on modern CPUs requires coordinating hardware capabilities with software optimizations across memory allocation, parallel execution, and mathematical kernel libraries. Intel Ice Lake Xeon processors deliver up to seventy-five percent faster inference across natural language processing tasks compared to Cascade Lake by combining Sunny Cove architecture improvements with dedicated extensions like Intel Extension for PyTorch. Fine-tuning software knobs such as alternative allocators, threading runtimes like Intel OpenMP, and core allocations can involve thousands of possible configuration combinations. Rather than evaluating these combinations through exhaustive brute force, Bayesian optimization via Intel SigOpt achieves comparable latency within roughly twenty trials and reveals experiment-dependent parameter importance. These software tuning strategies enable low-latency production transformer serving without dedicated accelerators.


### [Shopify's Path to a Faster Trino Query Execution: Custom Verification, Benchmarking, and Profiling Tooling](https://yomu.fyi/post/shopify-s-path-to-a-faster-trino-query-execution-custom-verification-b.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Oct 27, 2021
- Type: Problem & solution

Shopify needed safer ways to evaluate Trino configuration changes and software upgrades as its forked, hundreds-node cluster handled more data and data scientists depended on fast queries. The Data Reliability team built a lightweight Python library that centralizes Trino query orchestration, then exposed it through PyTest fixtures for repeatable verification, including correctness checks and candidate-versus-control comparisons. The broader framework also supports benchmarking and profiling concepts such as replaying historical queries, reproducing traffic patterns, and testing autoscaling, although the project ultimately focused most of its performance-testing scope on verification. Extensive correctness tests helped the Data Foundations team complete a successful Trino upgrade, while p95 query execution time remained stable over the reported period; the library was designed to leave room for more advanced interfaces later.


### [Large Language Models: A New Moore's Law?](https://yomu.fyi/post/large-language-models-a-new-moore-s-law.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Julien Simon
- Published: Oct 26, 2021
- Type: Problem & solution

Recent advancements in generative artificial intelligence have spurred the rapid growth of large language models like Megatron-Turing NLG 530B, which require vast financial investments and substantial energy consumption. Training these massive parameter architectures demands hundreds of multi-GPU servers and generates significant carbon footprints for relatively modest benchmark gains. Rather than relying on brute-force scaling, engineering teams can adopt smaller, more frugal architectures through knowledge distillation and transfer learning techniques. Practical alternatives include fine-tuning existing pretrained models, deploying on energy-efficient cloud infrastructure, and applying optimizations like pruning, layer fusion, and quantization. These methods deliver low-latency inference and high task accuracy while significantly decreasing hardware requirements, development time, and environmental impact.


### [Debugging Systems in the Cloud: MySQL, Kubernetes, and Cgroups](https://yomu.fyi/post/debugging-systems-in-the-cloud-mysql-kubernetes-and-cgroups.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Oct 21, 2021
- Type: Incident / postmortem

KateSQL, Shopify’s Database-as-a-Service platform on GKE, investigated why otherwise comparable MySQL Pods took between 10 and 30 minutes to be created during instance replacement. Measurements found extreme differences for Pods with identical resources and datasets: one required 2,120 seconds for initialization and 1,104 seconds for startup, while another took 74 and 17 seconds, respectively; affected Pods also accumulated more slow queries involving temporary memory tables. Profiling showed InnoDB’s single-threaded buffer pool initialization spending substantial time in mmap calls and the Linux memory cgroup function mem\_cgroup\_commit\_charge, while affected nodes had roughly 50,000 memory cgroups. The team linked the slowdown to a Linux kernel cgroup memory leak and slab reparenting behavior, then improved performance through node replacement, memory.force\_empty testing, and GKE 1.18 upgrades with relevant fixes.


### [GitHub Does My Operations Homework: A Ruby Speed Story](https://yomu.fyi/post/github-does-my-operations-homework-a-ruby-speed-story.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Oct 19, 2021
- Type: Tutorial

YJIT’s benchmarking site combines open-source benchmark runners with Jekyll, GitHub Pages, and GitHub Actions to publish frequently refreshed results. The author wanted to compare Ruby configurations, expand reporting beyond console output, and avoid recurring operational work. Benchmarks run on an AWS instance rather than in GitHub Actions, while Actions schedules jobs, uses repository secrets for SSH, and commits generated data back to the repository; Jekyll builds the Pages site from that data. Reports include D3.js and Ruby-generated SVG graphs, tables, textual summaries, and JSON tripwire data that can trigger an issue when performance drops too far. The reported results show YJIT 20.6% faster than interpreted CRuby and 17.4% faster than MJIT, with Railsbench gains of 18.5% and 21.0% respectively.


### [Try Out YJIT for Faster Rubying](https://yomu.fyi/post/try-out-yjit-for-faster-rubying.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Oct 15, 2021
- Type: Tutorial

YJIT is Shopify’s just-in-time compiler for CRuby, designed to convert frequently used code into optimized native machine code. Early results include a 20% or more improvement on a simple hello, world Rails benchmark, while production-app benchmarking and one real web service showed about a 6% speedup on a small percentage of traffic. The guide covers building a YJIT-enabled Ruby from source with Autoconf, make, OpenSSL, and GCC or Clang, then switching to it with a Ruby version manager and enabling YJIT explicitly. It shows how to verify installation, compare test and benchmark runs, and collect runtime statistics about generated code, compiled ISEQs, and interpreter versus YJIT instruction execution. The implementation ran Shopify’s full unit tests, similar GitHub tests, and limited production traffic, but remains in progress and invites issue reports about crashes, errors, and speed.


### [YJIT: Building a New JIT Compiler for CRuby](https://yomu.fyi/post/yjit-building-a-new-jit-compiler-for-cruby.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Oct 14, 2021
- Type: Explainer

YJIT is a new just-in-time compiler being built inside CRuby to improve Ruby performance on modern hardware, where single-core speed gains are limited and energy efficiency matters. Unlike MJIT’s weaker results on large real-world applications, YJIT uses a data-driven focus on performance hotspots in Rails and Shopify Core and is based on Basic Block Versioning (BBV). After about one year, it reports speedups over the CRuby interpreter of 20% on railsbench, 39% on liquid template rendering, and 37% on activerecord, with near-peak performance after one benchmark iteration. YJIT passes CRuby’s roughly 30,000-test suite, Shopify Core and GitHub backend CI, while running on a small percentage of Shopify production servers; its team plans further CRuby changes and broader JIT coverage before and after its intended Ruby 3.1 integration.


### [Winning AI4TSP: Solving the Travelling Salesperson Problem with Self-programming Machines](https://yomu.fyi/post/winning-ai4tsp-solving-the-travelling-salesperson-problem-with-self-pr.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Oct 6, 2021
- Type: Benchmark

The 2021 AI4TSP Competition addressed the Travelling Salesperson Problem when travel times are sampled from probability distributions and locations carry rewards and time windows. With n locations, the number of possible tours is n!, making exhaustive enumeration impractical, while the competition also required decisions under uncertain travel outcomes. One track required a fixed tour optimized for expected performance across scenarios; the other allowed an adaptive policy to select the next location as time elapsed, with results evaluated across many instances and realizations. The Shopify-led team used dialectic search for the fixed-tour track and deep reinforcement learning for the on-the-fly track, and won first prize in both.


[Newer posts](https://yomu.fyi/topic/performance/page/35.md) · [Older posts](https://yomu.fyi/topic/performance/page/37.md)
