Skip to content

Conversation

@OrbisK
Copy link
Member

@OrbisK OrbisK commented Oct 31, 2025

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I was actually looking for other things and came across these improvements. In some places, you could certainly use a map instead of an object record, but that would then affect some exported APIs.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link

vercel bot commented Oct 31, 2025

@OrbisK is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 31, 2025

npm i https://pkg.pr.new/@nuxt/content@3591

commit: a3fc107

@farnabaz
Copy link
Member

farnabaz commented Nov 4, 2025

Thanks for the PR,
Although that PR looks good, but I'm not sure about the performance improvement here, Map has overhead of indexing had is good choice for large set of data, but here we are using object for small set of data which is slightly faster in object as far as I know.

It would be great if we can have a benchmark two decide between them.

Copy link
Member

@farnabaz farnabaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran a small test on Map and Object and the result was almost same with small data.
Beside performance using map is better for security and readability.

Thanks for PR

@farnabaz farnabaz merged commit 7b16de3 into nuxt:main Nov 6, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants