Skip to content

Performance: Remove avatarUrl convert overhead in DevIndex Contributor Model #9309

@tobiu

Description

@tobiu

The DevIndex backend spider engine fetches raw avatar_url from the GitHub REST API. Previously, the DevIndex.model.Contributor was performing an expensive convert operation on instantiation to map this into a full URL format under the avatarUrl field.

To optimize performance for 50k+ records, this ticket removes the convert overhead. The model now maps the raw ID string into the avatarUrl field directly.

Consequently, the UI components (GitHubUser, GitHubOrgs, and ProfileContainer) have been updated to smartly detect if avatarUrl is a full HTTP string or just an ID, dynamically constructing the https://avatars.githubusercontent.com/... link at render time. This maintains compatibility for both the highly optimized DevIndex app and general framework usage.

Changes:

  • apps/devindex/model/Contributor.mjs: Removed convert overhead for avatarUrl and organizations.
  • apps/devindex/view/home/ProfileContainer.mjs: Updated getAvatarUrl() to handle raw IDs.
  • src/component/GitHubUser.mjs: Updated URL construction logic.
  • src/component/GitHubOrgs.mjs: Updated URL construction logic.
  • src/grid/column/GitHubUser.mjs: Mapped avatarUrl from record.avatarUrl.

Metadata

Metadata

Assignees

Labels

aienhancementNew feature or requestperformancePerformance improvements and optimizations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions