CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • "profiling mode" exists ?
Pages: [1]

Author Topic: "profiling mode" exists ?  (Read 1196 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
"profiling mode" exists ?
September 10, 2010, 02:00:41 am
Hi,

Find that generating a profile is super slow sometimes (and as I need it for petition signatures, it might end up being hammered, it has to be fast), before investigating caching, was wondering if there is a "profile/debug plugin" (a bit like for drupal):

Eg, you can add (visible only to admin) a block that displays

#of sql requests
#sql time
#total time

Does it exists? If not, will try modifying the DAO to add the counter (hack/proof of concept)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "profiling mode" exists ?
September 10, 2010, 06:37:59 am

install drupal's devel module

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: "profiling mode" exists ?
September 10, 2010, 06:55:27 am
Quote from: Donald Lobo on September 10, 2010, 06:37:59 am

Are the sql requests from civicrm counted in too ?

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "profiling mode" exists ?
September 10, 2010, 07:58:43 am

yes

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: "profiling mode" exists ?
September 11, 2010, 03:20:31 am
Cool, found a hot spot I think: When using the profiles, seem that quite a few similar requests are called several time.

eg: this is called 50 times:

Code: [Select]
SELECTIF ( civicrm_email.location_type_id IS NULL, IF ( civicrm_address.location_type_id IS NULL, IF ( civicrm_phone.location_type_id IS NULL, IF ( civicrm_im.location_type_id IS NULL, IF ( civicrm_openid.location_type_id IS NULL, null, civicrm_openid.location_type_id) ,civicrm_im.location_type_id) ,civicrm_phone.location_type_id) ,civicrm_address.location_type_id) ,civicrm_email.location_type_id) as locationType FROM civicrm_contact LEFT JOIN civicrm_email ON ( civicrm_email.is_primary = 1 AND civicrm_email.contact_id = civicrm_contact.id ) LEFT JOIN civicrm_address ON ( civicrm_address.is_primary = 1 AND civicrm_address.contact_id = civicrm_contact.id) LEFT JOIN civicrm_phone ON ( civicrm_phone.is_primary = 1 AND civicrm_phone.contact_id = civicrm_contact.id) LEFT JOIN civicrm_im ON ( civicrm_im.is_primary = 1 AND civicrm_im.contact_id = civicrm_contact.id) LEFT JOIN civicrm_openid ON ( civicrm_openid.is_primary = 1 AND civicrm_openid.contact_id = civicrm_contact.id) WHERE civicrm_contact.id = 1

and this as well.

Code: [Select]
SELECT v.name as name ,v.value as value, v.grouping as grouping FROM civicrm_option_value v, civicrm_option_group g WHERE v.option_group_id = g.id AND g.name = 'address_options' AND v.is_active = 1 AND g.is_active = 1 ORDER BY v.weight

Is there an option to display the call stack ? Right now, it says that the function is executeQuery, that doesn't come as a surprise, but doesn't help to find  ;)


-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • "profiling mode" exists ?

This forum was archived on 2017-11-26.