[wp-trac] [WordPress Trac] #44921: User nicename discovery is slow to return

WordPress Trac noreply at wordpress.org
Fri Sep 13 00:31:29 UTC 2024


#44921: User nicename discovery is slow to return
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  pbearne
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  6.7
Component:  Users                                |     Version:  2.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 As the purpose here is to ensure the user nicename is unique, I think
 introducing `wp_unique_user_nicename()` would be a better option to match
 this similarly named functions for post and term slugs.

 I'm also curious to know the real world improvements available here. While
 inserting 1000 users with the `test_user` as the slug will result in some
 performance impact, I don't think it reflect reality.

 In the case of WordPress.org if someone enters the nicename
 `peterwilsoncc` then the most likely situation is one or two queries
 before a unique suffix is found. `peter` would result in a few more
 queries but I don't see how querying the full user object rather than only
 the nicename is much of a n improvement.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44921#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list