René's URL Explorer Experiment


Title: Select dropdowns with ngValue binding perform far worse than expected · Issue #41330 · angular/angular · GitHub

Open Graph Title: Select dropdowns with ngValue binding perform far worse than expected · Issue #41330 · angular/angular

X Title: Select dropdowns with ngValue binding perform far worse than expected · Issue #41330 · angular/angular

Description: 🐞 bug report Affected Package The issue is caused by package @angular/forms Is this a regression? Regression from AngularJS. Description I noticed that there was a noticeable delay when populating a select dropdown with several hundred+ ...

Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/forms Is this a regression? Regression from AngularJS. Description I noticed that there was a noticeable delay when populating ...

X Description: 🐞 bug report Affected Package The issue is caused by package @angular/forms Is this a regression? Regression from AngularJS. Description I noticed that there was a noticeable delay when populating ...

Opengraph URL: https://github.com/angular/angular/issues/41330

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Select dropdowns with ngValue binding perform far worse than expected","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\nThe issue is caused by package @angular/forms\r\n\r\n### Is this a regression?\r\n\r\nRegression from AngularJS.\r\n\r\n### Description\r\n\r\nI noticed that there was a noticeable delay when populating a select dropdown with several hundred+ items using an ngValue binding, which does not occur with other frameworks (I also tested AngularJS and Svelte). Digging into the Angular code it turns out that the `_compareWith` function in select_control_value_accessor.ts is being called an absurdly high number of times.\r\n\r\nI expected that this function would just be called no more than once for each item in the dropdown (i.e. loop through the options until a match is found). However, it is actually called exponentially more. E.g. for a dropdown with 1000 items and the 500th item bound to the ngModel, the function is called 501,001 times. If there are 3000 items in the dropdown and the 1500th item is selected, the `_compareWith` function is called 1,002,501 times. It gets even worse if an option nearer the end of the list is selected.\r\n\r\n## 🔬 Minimal Reproduction\r\nhttps://stackblitz.com/edit/angular-select-performance?file=src%2Fapp%2Fapp.component.ts\r\n\r\nNote that I added a custom `compareWith` method in this example to log how many times it is called, but the performance is just as bad with the default internal comparison method.\r\n\r\nI think the problem stems from Angular's `SelectControlValueAccessor.writeValue()` method being called over and over for each individual option element that is rendered, rather than once after all the options are rendered.\r\n\r\n## 🌍  Your Environment\r\n\r\n**Angular Version:** 11.2.6\r\n\r\n**Anything else relevant?**\r\nThis is especially problematic for our users with slower mobile devices.","author":{"url":"https://github.com/theodorejb","@type":"Person","name":"theodorejb"},"datePublished":"2021-03-23T21:15:27Z","url":"https://github.com/angular/angular/issues/41330"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3e4a6528-8a7f-b1d7-c10d-7377d4a89eda
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEA8E:FC5BE:17AA0B7:1F655C5:6B01435C
html-safe-noncef6fcf6d2768b57497e1fc54ee5ee73dcf217e2b568b9cae13983f4d363084899
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQThFOkZDNUJFOjE3QUEwQjc6MUY2NTVDNTo2QjAxNDM1QyIsInZpc2l0b3JfaWQiOiI4NzQyNzQ5MDgzNTEwMzI2MTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd7f55e88c1f14c1f4579f534cbad62ada238a89f35a4afdfbf555afaed1fc83f
hovercard-subject-tagissue:839129221
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/41330/issue_layout
twitter:imagehttps://opengraph.githubassets.com/04beaa446809cf5fe23178026f38d5c09c4f473553e72628ddec2560e882ce2b/angular/angular/issues/41330
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/04beaa446809cf5fe23178026f38d5c09c4f473553e72628ddec2560e882ce2b/angular/angular/issues/41330
og:image:alt🐞 bug report Affected Package The issue is caused by package @angular/forms Is this a regression? Regression from AngularJS. Description I noticed that there was a noticeable delay when populating ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametheodorejb
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/41330#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F41330
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F41330
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/41330
Reloadhttps://github.com/angular/angular/issues/41330
Reloadhttps://github.com/angular/angular/issues/41330
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/41330
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/41330
Select dropdowns with ngValue binding perform far worse than expectedhttps://github.com/angular/angular/issues/41330#top
https://github.com/AndrewKushnir
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
area: performanceIssues related to performancehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20performance%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/theodorejb
theodorejbhttps://github.com/theodorejb
on Mar 23, 2021https://github.com/angular/angular/issues/41330#issue-839129221
https://stackblitz.com/edit/angular-select-performance?file=src%2Fapp%2Fapp.component.tshttps://stackblitz.com/edit/angular-select-performance?file=src%2Fapp%2Fapp.component.ts
josephperrotthttps://github.com/josephperrott
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
on Mar 23, 2021https://github.com/angular/angular/issues/41330#event-4498661775
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Mar 23, 2021https://github.com/angular/angular/issues/41330#event-4498661843
AndrewKushnirhttps://github.com/AndrewKushnir
area: performanceIssues related to performancehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20performance%22
on Mar 23, 2021https://github.com/angular/angular/issues/41330#event-4498900312
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Mar 23, 2021https://github.com/angular/angular/issues/41330#issuecomment-805319599
#25859https://github.com/angular/angular/pull/25859
#19723https://github.com/angular/angular/issues/19723
AndrewKushnirhttps://github.com/AndrewKushnir
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
on Mar 23, 2021https://github.com/angular/angular/issues/41330#event-4498914461
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Mar 23, 2021https://github.com/angular/angular/issues/41330#event-4498914506
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Mar 24, 2021https://github.com/angular/angular/issues/41330#issuecomment-806063354
see herehttps://github.com/angular/angular/blob/master/packages/forms/src/directives/select_control_value_accessor.ts#L140
some POC changeshttps://github.com/angular/angular/compare/master...AndrewKushnir:forms_41330?expand=1
#25859https://github.com/angular/angular/pull/25859
AndrewKushnirhttps://github.com/AndrewKushnir
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%22
on Mar 24, 2021https://github.com/angular/angular/issues/41330#event-4503654704
AndrewKushnirhttps://github.com/AndrewKushnir
on Mar 24, 2021https://github.com/angular/angular/issues/41330#event-4503655450
https://github.com/theodorejb
theodorejbhttps://github.com/theodorejb
on Mar 24, 2021https://github.com/angular/angular/issues/41330#issuecomment-806071984
@AndrewKushnirhttps://github.com/AndrewKushnir
#23784https://github.com/angular/angular/pull/23784
https://github.com/artuska
artuskahttps://github.com/artuska
on Apr 6, 2022https://github.com/angular/angular/issues/41330#issuecomment-1090228184
atscotthttps://github.com/atscott
on Jun 6, 2025https://github.com/angular/angular/issues/41330#event-18027958517
fix(forms): improve select performance and ensure that selected optio…https://github.com/atscott/angular/commit/f26b0cb9c3623c3a1acec3bd8c6a1f344f0947f0
f26b0cbhttps://github.com/atscott/angular/commit/f26b0cb9c3623c3a1acec3bd8c6a1f344f0947f0
fix(forms): improve select performancehttps://github.com/atscott/angular/commit/ddccb24f9285afcf35e7a7aaf4897ddeee00bf95
ddccb24https://github.com/atscott/angular/commit/ddccb24f9285afcf35e7a7aaf4897ddeee00bf95
fix(forms): improve select performancehttps://github.com/atscott/angular/commit/7d1a59ba769dae6565a05de12386d5cbf126ab91
7d1a59bhttps://github.com/atscott/angular/commit/7d1a59ba769dae6565a05de12386d5cbf126ab91
fix(forms): improve select performancehttps://github.com/atscott/angular/commit/3f8187406bec7cbcfd05425485dff534e6c543bf
3f81874https://github.com/atscott/angular/commit/3f8187406bec7cbcfd05425485dff534e6c543bf
fix(forms): improve select performancehttps://github.com/atscott/angular/commit/cd961cb43403c7bdf29dfea5256ea57cf1f60b14
cd961cbhttps://github.com/atscott/angular/commit/cd961cb43403c7bdf29dfea5256ea57cf1f60b14
AndrewKushnirhttps://github.com/AndrewKushnir
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
4f0221ehttps://github.com/angular/angular/commit/4f0221e1933675b24bdbf95be3825fdacee13c00
on Jun 10, 2025https://github.com/angular/angular/issues/41330#event-18082170372
AndrewKushnirhttps://github.com/AndrewKushnir
on Jun 10, 2025https://github.com/angular/angular/issues/41330#event-18082170660
fix(forms): improve select performance (#61949)https://github.com/angular/angular/commit/4f0221e1933675b24bdbf95be3825fdacee13c00
#61949https://github.com/angular/angular/pull/61949
4f0221ehttps://github.com/angular/angular/commit/4f0221e1933675b24bdbf95be3825fdacee13c00
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jul 11, 2025https://github.com/angular/angular/issues/41330#issuecomment-3059656143
automatic conversation locking policyhttps://github.com/angular/angular/blob/f0fbced1c55bc8b8ed9df01cea99df42f3e7eae3/contributing-docs/auto-issue-locking.md
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jul 11, 2025https://github.com/angular/angular/issues/41330#event-18575783604
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/41330
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/41330
AndrewKushnirhttps://github.com/AndrewKushnir
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
area: performanceIssues related to performancehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20performance%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.