Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Sorting by Removing Unnecessary Array Copy in JournalPage.tsx #290

Open
sneha3004pandey opened this issue Oct 29, 2024 · 1 comment

Comments

@sneha3004pandey
Copy link

In the JournalPage.tsx component, the sortedEntries function currently creates a shallow copy of filteredEntries (via const sorted = [...filteredEntries]) before sorting. This step may lead to memory inefficiency, as it duplicates the array even when a copy isn’t required for further use.

Issue:
The line const sorted = [...filteredEntries].sort(...) creates an unnecessary shallow copy of filteredEntries, potentially increasing memory usage and affecting performance, especially with large datasets.

@sid0000007
Copy link
Contributor

@sneha3004pandey Go ahead

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

No branches or pull requests

2 participants