Uh oh!
There was an error while loading. Please reload this page.
util: remove style caches from styleText slow path - #63706
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors styleText to reduce reliance on the prebuilt style cache and to build ANSI sequences directly from inspect.colors, while also simplifying the hex-color styling path.
Changes:
- Lazily initializes the style cache only in the
validateStream=falsefast path. - Replaces cached style lookups with direct reads from
inspect.colorsand inline ANSI open/close sequence construction. - Reworks hex color handling to compute 24-bit ANSI sequences directly instead of using the hex style cache.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #63706 +/- ##
==========================================
- Coverage 90.35% 90.34% -0.01%
==========================================
Files 732 732 Lines 236684 236690 +6 Branches 44579 44582 +3 ==========================================
- Hits 213855 213845 -10 - Misses 14544 14557 +13 - Partials 8285 8288 +3
🚀 New features to boost your workflow:
|
5dc48c3 to
5980e4fCompareSigned-off-by: Guilherme Araújo <arauujogui@gmail.com>
5980e4f to
6f4298dComparearaujogui
commented
Jun 2, 2026
CC @nodejs/performance |
nodejs-github-bot
commented
Jun 7, 2026
Commit Queue failed- Loading data for nodejs/node/pull/63706 ✔ Done loading data for nodejs/node/pull/63706 ----------------------------------- PR info ------------------------------------ Title util: remove style caches from styleText slow path (#63706) Author Guilherme Araújo <arauujogui@gmail.com> (@araujogui) Branch araujogui:util-styletext-no-cache -> nodejs:main Labels util, needs-ci Commits 1 - util: remove style caches from styleText slow path Committers 1 - Guilherme Araújo <arauujogui@gmail.com> PR-URL: https://github.com/nodejs/node/pull/63706 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/63706 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> -------------------------------------------------------------------------------- ℹ This PR was created on Mon, 01 Jun 2026 22:01:24 GMT ✔ Approvals: 2 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/63706#pullrequestreview-4435453199 ✔ - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/63706#pullrequestreview-4436132152 ✔ Last GitHub CI successful ✘ No Jenkins CI runs detected -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/27086912762 |
This comment was marked as outdated.
This comment was marked as outdated.
nodejs-github-bot
commented
Jun 9, 2026
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Jun 9, 2026
Landed in 4899634 |
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: #63706 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: #63706 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: #63706 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Remove the caches from the slow path since they don't improve performance there. validation dominates the cost, making the lookup savings negligible