No description
Find a file
Robin Malfait af3345189a
Improve walk(…) performance (#15529)
This PR is a tiny improvement to the `walk(…)` implementations, not a
super big
deal but thought about something and was pleasently surprised that it
did have
an impact.

The idea is twofold:

1. Reduce array allocations while walking to build a `path` to the
current node. This re-uses the existing `path` array and pushes the
current node before the recursive call and pops it afterwards. This way
we don't need to allocate a new array for each recursive call. Testing
this on Tailwind UI means ~14k fewer allocations.
2. Instead of always calling `.splice(…)`, we can directly update a
single value in the array if we are replacing a node with another node.
   
Testing on the Tailwind UI codebase, this results in:

![image](https://github.com/user-attachments/assets/5a1c2102-1493-410f-b527-847fb4a75b31)

---------

Co-authored-by: Philipp Spiess <hello@philippspiess.com>
2025-01-06 14:27:55 +00:00
.github use single quotes 2024-12-13 15:30:58 +01:00
crates Apply Clippy suggestions (#15549) 2025-01-06 11:59:31 +01:00
integrations Improve integration tests (stability + performance) (#15125) 2024-12-12 13:48:56 +01:00
packages Improve walk(…) performance (#15529) 2025-01-06 14:27:55 +00:00
patches Upgrade @parcel/watcher to 2.5.0 (#14978) 2024-11-13 11:38:43 +01:00
playgrounds 🚨 [security] Update all of nextjs 15.1.0 → 15.1.3 (patch) (#15535) 2025-01-06 10:23:13 +00:00
scripts Fix integration tests on Windows (#14824) 2024-10-30 11:26:29 +00:00
.gitignore Add test.debug to integration tests (#14133) 2024-08-08 12:02:19 +02:00
.npmrc introduce v4 codebase 2024-03-05 14:29:15 +01:00
.prettierignore Hoist oxide/crates to just crates (#13333) 2024-03-23 09:00:48 -04:00
Cargo.lock Auto source detection improvements (#14820) 2024-10-29 20:33:34 +00:00
Cargo.toml Hoist oxide/crates to just crates (#13333) 2024-03-23 09:00:48 -04:00
CHANGELOG.md Improve walk(…) performance (#15529) 2025-01-06 14:27:55 +00:00
LICENSE Add README, LICENSE, and CONTRIBUTING (#13088) 2024-03-05 14:45:39 -05:00
package.json Update @playwright/test 1.49.0 → 1.49.1 (patch) (#15550) 2025-01-06 11:33:25 +00:00
pnpm-lock.yaml Update bun 1.1.40 → 1.1.42 (patch) (#15551) 2025-01-06 12:45:16 +01:00
pnpm-workspace.yaml Update Vite to 6.0 (#15197) 2024-11-27 11:34:50 -05:00
README.md Copy README file to every package (#13096) 2024-03-06 08:49:31 -05:00
rust-toolchain.toml Bring back rust-toolchain.toml (#14585) 2024-10-03 14:37:24 +00:00
turbo.json Auto source detection improvements (#14820) 2024-10-29 20:33:34 +00:00
vitest.workspace.ts introduce v4 codebase 2024-03-05 14:29:15 +01:00

Tailwind CSS

A utility-first CSS framework for rapidly building custom user interfaces.

Build Status Total Downloads Latest Release License


Documentation

For full documentation, visit tailwindcss.com.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discuss Tailwind CSS on GitHub

For chatting with others using the framework:

Join the Tailwind CSS Discord Server

Contributing

If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.