Skip to content

perf: compile default bot matcher at build time - #318

Merged
harlan-zw merged 3 commits into
mainfrom
perf/compile-bot-matcher
Aug 11, 2026
Merged

perf: compile default bot matcher at build time#318
harlan-zw merged 3 commits into
mainfrom
perf/compile-bot-matcher

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

nuxt-ai-ready called createPatternMap() during bot negotiation on every SSR. Generate a compact regex matcher from BOT_MAP during the package build, while custom maps keep request-local behavior.

SSR CPU fell between 17% and 26% across three controlled runs. The SSR module profile allocated 23.3 KiB less per request. robots.txt and llms.txt crossed baseline in both directions.

@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxtjs/robots@318

commit: 9c3b8c2

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

📦 Package Size

⚠️ 2 size metrics grew

Package output Gzipped Δ
@nuxtjs/robots · export ./util 5.9 kB → 6.6 kB 🔴 +696 B (+11.8%)
@nuxtjs/robots · published payload 35 kB → 36 kB 🔴 +1.4 kB (+4.0%)
All tracked output (10)
Package output Gzipped Raw
@nuxtjs/robots · dependency @fingerprintjs/botd 13 kB 55 kB
@nuxtjs/robots · dependency h3 34 kB 146 kB
@nuxtjs/robots · dependency nuxt-site-config 9.8 kB 24 kB
@nuxtjs/robots · dependency nuxtseo-shared 20 kB 65 kB
@nuxtjs/robots · export . 5.3 kB 20 kB
@nuxtjs/robots · export ./content 292 B 503 B
@nuxtjs/robots · export ./util 6.6 kB 25 kB 🔴
@nuxtjs/robots · published payload 36 kB 121 kB 🔴
@nuxtjs/robots · app runtime 2.5 kB 6.2 kB
@nuxtjs/robots · server runtime 8.6 kB 22 kB
Runtime dependencies (10)
Package Dependency Requested Resolved Cost
@nuxtjs/robots @fingerprintjs/botd ^2.0.0 2.0.0 📦 13 kB gzip
@nuxtjs/robots @nuxt/kit ^4.5.2 4.5.2 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots consola ^3.4.2 3.4.2 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots defu ^6.1.7 6.1.7 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots h3 ^1.15.11 1.15.11 📦 34 kB gzip
@nuxtjs/robots nuxt-site-config ^4.2.0 4.2.0 📦 9.8 kB gzip
@nuxtjs/robots nuxtseo-shared ^5.3.11 5.3.11 📦 20 kB gzip
@nuxtjs/robots pathe ^2.0.3 2.0.3 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots pkg-types ^2.3.1 2.3.1 ♻️ free via Nuxt 4.5.2
@nuxtjs/robots ufo ^1.6.4 1.6.4 ♻️ free via Nuxt 4.5.2

Baseline: main_@_1998e6d___2026-08-10 · gzip is the comparison metric · changes below 16 B gzip are ignored

@harlan-zw
harlan-zw merged commit ab34ffa into main Aug 11, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant