concord-consortium / codap

CODAP (Common Online Data Analysis Platform)
MIT License
94 stars 38 forks source link

187178550 v3 Improve Item Sort #1396

Closed tealefristoe closed 4 weeks ago

tealefristoe commented 1 month ago

PT Story: https://www.pivotaltracker.com/story/show/187178550

This PR improves the efficiency of the notify itemSearch itemOrder API request by adding a new dataset.moveItems action that rearranges the order of items without removing them and then re-adding them.

As a step towards this solution, I also improved the efficiency of dataset.removeCases, changing it from O(n^2) to O(n*log(n)). Even though the API request no longer uses this action, it still seemed worth keeping the improvement for other cases where it's used.

I tested all three variants with tables shared between three users with approximately 5000 items. Here are the results:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.93%. Comparing base (81c2675) to head (6d41262). Report is 2 commits behind head on main.

Files Patch % Lines
v3/src/models/data/data-set.ts 97.22% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1396 +/- ## ========================================== - Coverage 85.95% 85.93% -0.03% ========================================== Files 533 533 Lines 25988 26011 +23 Branches 7083 7088 +5 ========================================== + Hits 22339 22353 +14 - Misses 3494 3503 +9 Partials 155 155 ``` | [Flag](https://app.codecov.io/gh/concord-consortium/codap/pull/1396/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium) | Coverage Δ | | |---|---|---| | [cypress](https://app.codecov.io/gh/concord-consortium/codap/pull/1396/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium) | `72.55% <37.50%> (-0.11%)` | :arrow_down: | | [jest](https://app.codecov.io/gh/concord-consortium/codap/pull/1396/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium) | `53.83% <97.50%> (+0.03%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cypress[bot] commented 1 month ago



Test summary

204 0 29 0Flakiness 1


Run details

Project codap-v3
Status Passed
Commit 0ec29dfc56
Started Aug 14, 2024 12:19 AM
Ended Aug 14, 2024 12:28 AM
Duration 08:44 💡
OS Linux Ubuntu -
Browser Chrome 127

View run in Cypress Cloud ➡️


Flakiness

cypress/e2e/text.spec.ts Flakiness
1 Text tile > updates text title with undo/redo

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud