perf(transformer/jsx): skip creating temp String#10721
perf(transformer/jsx): skip creating temp String#10721graphite-app[bot] merged 1 commit intomainfrom
String#10721Conversation
CodSpeed Instrumentation Performance ReportMerging #10721 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
cf127e8 to
4285278
Compare
9dfed3d to
0105253
Compare
4285278 to
acc7c22
Compare
acc7c22 to
e96f818
Compare
WalkthroughThe change updates the transformation logic for JSX namespaced element names in the codebase. Instead of converting the entire namespaced name into a string in one step, the new approach constructs the string literal by explicitly concatenating the namespace part, a colon character, and the local name part. This is achieved using a method that joins these parts into a single string literal. No changes were made to the declarations of exported or public entities. The modification is limited to how namespaced JSX element names are processed internally during transformation. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (7)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Merge activity
|
Small optimization. `JSXNamespacedName::to_string` creates a temporary `String` which is then immediately copied into the arena. Use `AstBuilder::atom_from_strs_array` instead to construct the string directly in arena. It's probably also cheaper than the `write!` formatter machinery that `impl Display for JSXIdentifier` uses.
e96f818 to
2256918
Compare

Small optimization.
JSXNamespacedName::to_stringcreates a temporaryStringwhich is then immediately copied into the arena.Use
AstBuilder::atom_from_strs_arrayinstead to construct the string directly in arena. It's probably also cheaper than thewrite!formatter machinery thatimpl Display for JSXIdentifieruses.