fetch all users / performance

Author Message

Gernot Rief

Tuesday 09 December 2003 4:33:59 am

hi!

i use the following code:
<select name="{$attribute_base}_ml_goto_{$attribute.id}[]" multiple size="25">

{section loop=fetch( content, list, hash( parent_node_id, 5,depth, 2, class_filter_type, "exclude", class_filter_array, array(3) ))}

<option value="{$:item.contentobject_id}"
{section show=and($attribute.content.uids|contains($:item.contentobject_id),is_array($attribute.content.uids))}selected="selected"{/section}
>{$:item.name|wash} ({$:item.data_map.user_account.content.email})

</option>

{/section}

</select>

= fetch all users into a selectbox and mark the users in $attribute.content.uids (=array of contentobject_ids) as selected.

the code works, but for 450 users it takes about 90 sec (!) to display the page (90% in template)

has anyone any idea how to speed this up?

thx, gernot

Sascha Frinken

Tuesday 09 December 2003 11:05:15 am

450 items (users) are too much for an option list.

You should consider creating a browse page, with a seach function and not more than 50 users per page. After choosing the user(s) from there you return back to where you need it.

You could also write an template operator that fetches the user info directly from the database which will speed things up.

hth

Sascha

Gernot Rief

Tuesday 09 December 2003 11:41:39 pm

hi!

thx for the answer.

writing an operator fixed my prob

gernot

Marco Zinn

Wednesday 10 December 2003 12:41:29 pm

Hi,
do you mind sharing the operator?
I have 7000 users and about 5000 are in one group.
Until now, i don't have to select users in a template dropdown, but it's just a matter of time.

BTW: Doesn't the workflow system (approval) use dropdown-list for users? Or does this use user groups?

Marco
http://www.hyperroad-design.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:00:02
Script start
Timing: Jan 18 2025 16:00:02
Module start 'layout'
Timing: Jan 18 2025 16:00:02
Module start 'content'
Timing: Jan 18 2025 16:00:04
Module end 'content'
Timing: Jan 18 2025 16:00:04
Script end

Main resources:

Total runtime1.5539 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.0469152.6250
Module start 'layout' 0.00720.0044 741.671939.4453
Module start 'content' 0.01161.5405 781.1172576.1484
Module end 'content' 1.55210.0017 1,357.265612.1641
Script end 1.5538  1,369.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.2903160.0003
Check MTime0.00140.0915160.0001
Mysql Total
Database connection0.00160.105410.0016
Mysqli_queries1.486095.6298620.0240
Looping result0.00070.0448600.0000
Template Total1.501496.620.7507
Template load0.00220.138420.0011
Template processing1.499396.486520.7496
Template load and register function0.00150.096310.0015
states
state_id_array0.00270.171610.0027
state_identifier_array0.00310.196820.0015
Override
Cache load0.00180.1156350.0001
Sytem overhead
Fetch class attribute can translate value0.00180.115530.0006
Fetch class attribute name0.00180.117250.0004
XML
Image XML parsing0.00130.081030.0004
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.00100.0625160.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs