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

feat(cells): Optimize default afterQuery by avoiding memcopy #11758

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

Philzen
Copy link
Contributor

@Philzen Philzen commented Dec 8, 2024

Just stumbled over this. Not sure how much the browser engines are optimized for this kinds of operations nowadays, but at the end of the day it cannot JIT it completely away and i guess it would still need to create a full copy in memory. Some of the "literature" seems to confirm this at least as best practice consideration:

At the end of the day one may consider this a neglectable micro-optimization, but as the redwood cell is the "work horse" for data piped to the frontend (which may potentially include large amounts of data) this may be worth it – at least it won't hurt 😉

@Philzen Philzen changed the title Avoid memcopy operation in default afterQuery cell result processing [OPTIMIZATION] Avoid memcopy operation in default afterQuery cell result processing Dec 8, 2024
@Tobbe Tobbe added the release:feature This PR introduces a new feature label Dec 9, 2024
@Tobbe Tobbe added this to the next-release milestone Dec 9, 2024
@Tobbe Tobbe changed the title [OPTIMIZATION] Avoid memcopy operation in default afterQuery cell result processing feat(cells): Optimize default afterQuery by avoiding memcopy Dec 9, 2024
@Tobbe Tobbe enabled auto-merge (squash) December 9, 2024 09:57
@Tobbe Tobbe merged commit 33a9d4b into redwoodjs:main Dec 9, 2024
50 checks passed
Tobbe added a commit that referenced this pull request Dec 25, 2024
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
@Tobbe Tobbe modified the milestones: next-release, v8.4.2 Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants