Inexpensive class identifier and ID convertion

Author Message

Piotrek Karaś

Friday 06 June 2008 12:39:30 pm

Hello there,

Is there an inexpensive method of converting class IDs to identifiers and identifiers to IDs?
There seems to be something in the cache dir, that looks like this:

<?php
$identifier_hash = array( "folder" => "1",
                          "user_group" => "3",
                          "user" => "4",
                          "image" => "5",
                          "link" => "11",
                          "file" => "12",
                          "comment" => "13",
                          "common_ini_settings" => "14",
                          "template_look" => "15"
                          ... );
?>

And the only converting method using this is eZContentObjectTreeNode::classIDByIdentifier()... Couldn't spot the opposite...

Shouldn't this be held somewhere in the session, so that conversion for any purposes doesn't require file system or db access?

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Kristof Coomans

Saturday 07 June 2008 9:36:26 pm

Hi Piotrek

The way of accessing data from this cache will be more streamlined in 4.1. See http://issues.ez.no/13068 and related commits in svn.

It might be a good idea to have this in the session, yes, although I guess the performance gain will be only small. Can you post an enhancement request for it in the issue tracker please?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Piotrek Karaś

Saturday 07 June 2008 10:25:25 pm

Hi Kristof,

I've just added an enhancement request:
http://issues.ez.no/IssueView.php?Id=13157&

As far as performance gain, you might be right, but think of a situation, where I need that for ten independent extensions, because each one makes use of such conversion. It would be much better to have a uniform tool for that to rely on.

Thanks,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

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 19 2025 04:36:44
Script start
Timing: Jan 19 2025 04:36:44
Module start 'layout'
Timing: Jan 19 2025 04:36:44
Module start 'content'
Timing: Jan 19 2025 04:36:45
Module end 'content'
Timing: Jan 19 2025 04:36:45
Script end

Main resources:

Total runtime1.0308 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 589.2891152.6406
Module start 'layout' 0.00740.0036 741.929739.4766
Module start 'content' 0.01101.0182 781.4063550.7891
Module end 'content' 1.02920.0015 1,332.195312.1250
Script end 1.0307  1,344.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3294160.0002
Check MTime0.00140.1367160.0001
Mysql Total
Database connection0.00070.071010.0007
Mysqli_queries0.975194.6016570.0171
Looping result0.00080.0793550.0000
Template Total0.983795.420.4919
Template load0.00220.210620.0011
Template processing0.981595.223520.4908
Template load and register function0.00010.010810.0001
states
state_id_array0.00250.243110.0025
state_identifier_array0.00210.199520.0010
Override
Cache load0.00180.1747230.0001
Sytem overhead
Fetch class attribute can translate value0.00120.112220.0006
Fetch class attribute name0.00100.093750.0002
XML
Image XML parsing0.00140.139620.0007
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00120.1151230.0001
String conversion0.00000.001240.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/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/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs