Forums / Developer / Inexpensive class identifier and ID convertion

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

eZ debug

Timing: Jan 19 2025 01:06:01
Script start
Timing: Jan 19 2025 01:06:01
Module start 'content'
Timing: Jan 19 2025 01:06:02
Module end 'content'
Timing: Jan 19 2025 01:06:02
Script end

Main resources:

Total runtime1.3949 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0129 589.0859180.8125
Module start 'content' 0.01301.1738 769.8984555.8828
Module end 'content' 1.18670.2081 1,325.7813336.7422
Script end 1.3948  1,662.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00510.3691210.0002
Check MTime0.00160.1125210.0001
Mysql Total
Database connection0.00120.082910.0012
Mysqli_queries1.285992.18991940.0066
Looping result0.00270.19201920.0000
Template Total1.352797.020.6763
Template load0.00300.213620.0015
Template processing1.349796.761820.6748
Template load and register function0.00010.009010.0001
states
state_id_array0.00120.087010.0012
state_identifier_array0.00130.096320.0007
Override
Cache load0.00240.1737230.0001
Sytem overhead
Fetch class attribute can translate value0.00140.103930.0005
Fetch class attribute name0.00150.106250.0003
XML
Image XML parsing0.00130.096230.0004
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.02251.6163340.0007
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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