I am having problem investigating why our profile edit page is damn slow.
Call Stack
# Time Memory Function Location
1 0.0003 276344 {main}( ) ...\index.php:0
2 1.6889 39666816 menu_execute_active_handler( ) ...\index.php:21
3 1.6899 39668968 call_user_func_array:{C:\wamp\www\hyperDrupal\includes\menu.inc:527} ( ) ...\menu.inc:527
4 1.6899 39669448 entity_ui_get_form( ) ...\menu.inc:527
5 1.6901 39696720 drupal_build_form( ) ...\entity.module:1282
6 1.7842 40984120 drupal_process_form( ) ...\form.inc:385
(7) 17.3247 58502824 form_execute_handlers( ) ...\form.inc:903
8 17.3247 58503344 profile2_form_submit_handler( ) ...\form.inc:1519
9 17.3265 58492400 profile2_save( ) ...\profile2.module:621
10 17.3265 58492528 Profile->save( ) ...\profile2.module:311
11 17.3265 58491736 Entity->save( ) ...\profile2.module:918
12 17.3265 58492096 EntityAPIController->save( ) ...\entity.inc:333
13 17.3737 58517352 EntityAPIController->invoke( ) ...\entity.controller.inc:462
(14) 23.5502 90243232 module_invoke_all( ) ...\entity.controller.inc:355
15 23.5511 90247648 call_user_func_array:{C:\wamp\www\hyperDrupal\includes\module.inc:951} ( ) ...\module.inc:951
16 23.5511 90248096 bdEvent_entity_update( ) ...\module.inc:951
17 23.5511 90248832 bdE\bdEvent->dispatch( ) ...\bdEvent.module:44
18 23.5567 90332840 bdE\Services\profileService->run( ) ...\bdEvent.php:38
19 23.5568 90333120 bdE\Services\profileService->entity_get_values( ) ...\profileService.php:24
I created a stack trace in a new module and times are huge. Check step 7 and 14 both are after long operations.
What could be taking so much between
6 1.7842 40984120 drupal_process_form( ) ...\form.inc:385
7 17.3247 58502824 form_execute_handlers( ) ...\form.inc:903
and between
13 17.3737 58517352 EntityAPIController->invoke( ) ...\entity.controller.inc:462
14 23.5502 90243232 module_invoke_all( ) ...\entity.controller.inc:355
drupal_process_form
executes the validators and submit handlers, including custom ones. Please post the form code, and any relevant submit handlers/validators etc. Without that, your guess is as good as mine. Also XHProf is probably more useful than a stack dump.