Skip to content

refactor(assist/useSortedAttributes): natural sorting and avoid cloning#5418

Merged
Conaclos merged 1 commit intomainfrom
conaclos/improve-useSortedAttributes
Mar 23, 2025
Merged

refactor(assist/useSortedAttributes): natural sorting and avoid cloning#5418
Conaclos merged 1 commit intomainfrom
conaclos/improve-useSortedAttributes

Conversation

@Conaclos
Copy link
Member

@Conaclos Conaclos commented Mar 23, 2025

Summary

The main goal of this PR is to change the sorting algorithm: we now use a naturl sort.

useSortedAttributes heavily use cloning.
I reduced the number of cloning and allocations. There is room for improvements, however this will require changing the code structure.
We now also check if the props are sorted before emitting a signal.

Also we now use unstable sort.

Test Plan

I added a test.

@Conaclos Conaclos requested review from a team March 23, 2025 19:59
@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 23, 2025
@Conaclos Conaclos force-pushed the conaclos/improve-useSortedAttributes branch from 35c4cea to 78b60fc Compare March 23, 2025 20:04
@Conaclos Conaclos merged commit 27a8466 into main Mar 23, 2025
15 checks passed
@Conaclos Conaclos deleted the conaclos/improve-useSortedAttributes branch March 23, 2025 20:32
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 23, 2025

CodSpeed Performance Report

Merging #5418 will not alter performance

Comparing conaclos/improve-useSortedAttributes (78b60fc) with main (486415e)

Summary

✅ 95 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments