---
title: "Building world-class product search at Shopify: Where C++ excellence meets ML innovation"
description: "Shopify's product search runs ML ranking models (transformers, neural rankers, CatBoost/LightGBM) at native C++ speed through RankFlow, a Python-like ranking DSL, and TurboDSL, its execution engine."
url: "https://swe.quest/articles/building-world-class-product-search-at-shopify-where-c-excellence-meets-ml-0dc65e1a92fe63ec"
canonical: "https://shopify.engineering/world-class-product-search"
source: "Shopify Engineering"
published: "2025-11-12"
difficulty: "easy"
kind: "Case study"
reading_minutes: 5
tags: ["search","performance","c-cpp","machine-learning","language-design"]
---

# Building world-class product search at Shopify: Where C++ excellence meets ML innovation

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2025-11-12, 5 min read, Case study. Original: [https://shopify.engineering/world-class-product-search](https://shopify.engineering/world-class-product-search)

## Summary

Shopify's product search runs ML ranking models (transformers, neural rankers, CatBoost/LightGBM) at native C++ speed through RankFlow, a Python-like ranking DSL, and TurboDSL, its execution engine. Data scientists write and deploy ranking modules in minutes without C++ expertise, while the runtime provides type safety, compile-time validation, vectorized execution and predictable latency. The team first shipped a simple engine (SimScorerDSL) that compiles DSL to C++ in about four weeks, then built TurboDSL behind the same syntax for a 48% speedup in ranking feature computation. Every PR gets an automated per-component latency analysis with significance testing at ±2% tolerance.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [C & C++](https://swe.quest/tags/c-cpp.md) (Languages)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Language design](https://swe.quest/tags/language-design.md) (Compilers & runtimes)

## Prerequisites

- search ranking basics ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- gradient boosted trees

## Keywords

RankFlow, TurboDSL, SimScorerDSL, LightGBM, CatBoost, Shopify

## Related posts

- [How Shopify improved consumer search intent with real-time ML](https://swe.quest/articles/how-shopify-improved-consumer-search-intent-with-real-time-ml-15d46e89bc4248e9.md): Shopify Engineering · 2024-10-18 · Medium · 8 min read · Inference & serving, Stream processing, ML platforms, Search, Cost optimization
  Shopify generates about 2,500 text and image embeddings per second (216M/day) in near real time with Google Cloud Dataflow and Apache Beam's RunInference on T4 GPUs, feeding Storefront Semantic Search and a BigQuery warehouse.
- [Leveraging multimodal LLMs for Shopify’s global catalogue: Recap of expo talk at ICLR 2025](https://swe.quest/articles/leveraging-multimodal-llms-for-shopify-s-global-catalogue-recap-of-expo-talk-at-5a595806db6311fb.md): Shopify Engineering · 2025-07-16 · Medium · 11 min read · LLMs, E-commerce, Model training, Inference & serving, Evaluation
  Shopify's Global Catalogue uses fine-tuned open-source vision LLMs (LLaVA 1.5 7B, then LLaMA 3.2 11B, now Qwen2VL 7B) to classify, extract attributes from, standardize and match billions of merchant product listings.
- [The generative recommender behind Shopify's commerce engine](https://swe.quest/articles/the-generative-recommender-behind-shopify-s-commerce-engine-f5ed1bac0cf956d4.md): Shopify Engineering · 2026-02-25 · Hard · 8 min read · Recommendations & ranking, Model training, Machine learning, E-commerce
  Shopify built a foundational generative recommender on HSTU that treats buyer journeys as raw event sequences and trains an autoregressive, causally masked model to predict the next product.
- [Shopify’s generative discovery model](https://swe.quest/articles/shopify-s-generative-discovery-model-99e5ac502d9a8c68.md): Shopify Engineering · 2026-11-11 · Hard · 12 min read · Recommendations & ranking, Search, LLMs, Inference & serving, Model training
  Shopify trained a single generative model, adapted from an open-weight LLM, that emits semantic-ID tokens to generate product candidates for both personalized search and recommendation across a catalog of billions.
- [Cross-store product clustering across millions of stores](https://swe.quest/articles/cross-store-product-clustering-across-millions-of-stores-c9b1fdcfbed466c6.md): Shopify Engineering · 2026-10-20 · Hard · 13 min read · Machine learning, E-commerce, Vector search, Algorithms, LLMs
  Shopify groups listings of the same product across millions of stores under a global Universal Product Identifier using a three-stage pipeline: embedding-based approximate nearest-neighbor retrieval to find candidate pairs, tiered pair scorers, and graph clustering.

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)
