1

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

closed as unclear what you're asking by Adrian Cid Almaguer, Kevin, Pierre.Vriens, Beebee, Neograph734 Jan 18 '17 at 16:07

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    This is difficult to answer without knowing what that form is doing to take so long. – Kevin Jan 18 '17 at 14:44
  • it's a simpler form I inherited using around 7 fields, all selects eg: country, city. – Pentium10 Jan 18 '17 at 14:56
  • 1
    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. – Beebee Jan 18 '17 at 16:03
  • Useful starting point for XHProf: Profiling Drupal 7 performance with XHProf and Devel – Beebee Jan 18 '17 at 16:10
2

Based on the backtrace, you won't know why your site is slow.

You should run a proper PHP profiler and analyse the results which can identify the slowest components.

It doesn't have to be Drupal it-self, but could be lack of caching or misconfiguration.

Some suggestions:

  • disable modules which you don't need (e.g. Devel, core Database Logging module, etc.),
  • upgrade your PHP to the latest or higher branch,
  • recompile your PHP for 64-bit or higher architecture depending on your CPU,
  • use the faster storage device for your db files or whole LAMP environment (e.g. SSD or memory-based filesystem),
  • use PHP debugger or profiler to find out any performance bottleneck (e.g. XDebug Profiler, DTrace or NuSphere PhpED PHP Profiler),
  • run some time-consuming drush command under gprof profiling tool, so you can find some performance bottleneck as well.

If disabling slow modules or profiling won't help, see: How do you improve Drupal performance?

Not the answer you're looking for? Browse other questions tagged or ask your own question.