Opened 9 years ago
Closed 9 years ago
#6847 closed enhancement (no action required)
xprofile_set_field_data is very slow
Reported by: | danielhuesken | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 2.4.0 |
Component: | Extended Profile | Keywords: | |
Cc: |
Description
I have writtzen a sync that syncs 27 xprofile fileds of 3000 Users. If i must make a initial sync it kan take a day. If im not sync the xprofile files it take minutes.
As secound if you save a Extended Profile (Backend Page) you can feel the slow save too.
In Sync i use the xprofile_set_field_data() function. The xprofile_get_field_data() is fast.
Change History (7)
#2
@
9 years ago
If i write directly to the BuddyPress Tables it is fast! But i will use the function so that i don't have problems on updates.
I will try to make the profile tomorrow
#3
@
9 years ago
Thanks. The XDebug profile will probably be pretty large (in megabytes), so you'll want to zip that up and put it up on Dropbox, or similar.
#4
@
9 years ago
I have done the Profiling. I have aborted the task so the the will not gets to big. Here you can download it https://dhue.de/dl/xprofile_set_field_data.zip. It works as a wp-cli command in the Class AGD\Sync\Models\SyncMembershipModel and the method update_wp.
#5
@
9 years ago
I have replaced the uploaded file with a newer one. That uses only 25 User to sync and is not so big in size.
Writes are always going to be slower than reads. You might want to consider splitting your sync into small batches so that each sync runs individually quicker. The cause may be your server infrastructure, not just BuddyPress or WordPress.
Alternatively, if you know how to configure XDebug and get a profile log generated, I'm happy to take a look through that and identify where the most time is spent. It may reveal slow parts of BuddyPress we could optimise, as what you're doing sounds like it's an edge case we've not tried before.