• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

postcss / postcss-selector-parser / 738 / 1
95%
master: 95%

Build:
DEFAULT BRANCH: master
Ran 19 Apr 2021 10:11AM UTC
Files 30
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Apr 2021 10:08AM UTC coverage: 95.418% (+0.04%) from 95.38%
738.1

push

travis-ci

web-flow
pref: rework unesc for a 63+% performance boost (#239)

* In profiling postcss I found that a significant amount of time was being
spent in [`unesc`](https://github.com/postcss/postcss-selector-parser/commits/master/src/util/unesc.js), this was due to the expensive regex checks that were
being performed on the fly for every selector in the codebase which looked to be performing quite poorly inside of modern node and v8.

![image](https://user-images.githubusercontent.com/883126/114136698-fdd98a80-98bf-11eb-8068-ace4f6f2274d.png)

----

As an experiment and based on some prior experience with this class of slowdown I migrated the implementation to one that performs a scan through the string instead of running a regex replace. By testing this on my local application I instantly saw the work from this function go from > 900 ms to ~100ms.

![image](https://user-images.githubusercontent.com/883126/114136734-0c27a680-98c0-11eb-82ab-f0c9529fd32d.png)

This implementation passes all of the existing test cases and aims to mirror the prior implementation's implementation details :)

-----

Based on my application I am seeing the major wins come from purgecss dropping my total application build by multiple seconds! 🔥

* Expand unesc handling to correctly handle spec edgecase for lone
surrogates and out of bound codepoint values.

753 of 854 branches covered (88.17%)

1312 of 1375 relevant lines covered (95.42%)

256.01 hits per line

Source Files on job 738.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 645
  • Travis Job 738.1
  • 1012e3a5 on github
  • Prev Job for on master (#724.2)
  • Next Job for on master (#741.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc