Skip to content
Snippets Groups Projects

Dumb-down avatar presence check in `avatar_url` methods

Merged Robert Speicher requested to merge rs-avatar_url-performance into master

avatar.present? goes through CarrierWave, and checks that the file exists on disk and checks its filesize. Because we're hitting the disk, this adds extra overhead to something where the worst-case scenario is rendering a broken image.

Instead, we now just check that the database attribute is present, which is good enough for our purposes.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/19273

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading