View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002377 | Composr | core | public | 2016-04-05 17:25 | 2016-06-26 22:45 |
Reporter | Chris Graham | Assigned To | Chris Graham | ||
Severity | Feature-request | ||||
Status | closed | Resolution | won't fix | ||
Product Version | |||||
Fixed in Version | |||||
Summary | 0002377: Tempcode optimisation - conditional parameter generation | ||||
Description | Don't generate and pass parameters into templates that we think may not be used... Example: BOX attribute for CNS_MEMBER_DIRECTORY_USERNAME may not be used in final template if the box tooltips are disabled, but is very heavy load so we don't want to generate it and carry it in the tree if not needed Create a template_may_use($template, $parameter) function template_may_use will work by having the run-time template cache prepped and querying the unbound Tempcode object within it; do_template and template_may_use may now both use a common function that does that cache prepping, to simplify the do_template code Make a temporary scanner to log all unused parameters so that we can mass-correct across the code-base template_may_use has to be aware that INCLUDE directives's may change what parameters are used - it has to be able to recurse into them | ||||
Additional Information | Particularly see all the stuff put into catalogue templates, e.g.... // Different ways of accessing the main field value, and pure version of it $field_name = get_translated_text($field['cf_name']); //$map['FIELDNAME_' . $str_i] = $field_name; //$fields_2d[] = array('NAME' => $field_name, 'VALUE' => $use_ev); $field_type = $field['cf_type']; //$map['FIELDTYPE_' . $str_i] = $field_type; $map['FIELD_' . $str_i] = $use_ev; $map['_FIELD_' . $str_id] = &$map['FIELD_' . $str_i]; if ($use_ev === $ev) { $map['FIELD_' . $str_i . '_PLAIN'] = &$map['FIELD_' . $str_i]; } else { $map['FIELD_' . $str_i . '_PLAIN'] = $ev; } $map['_FIELD_' . $str_id . '_PLAIN'] = &$map['FIELD_' . $str_i . '_PLAIN']; if ($ev === $field['effective_value_pure']) { $map['FIELD_' . $str_i . '_PURE'] = &$map['FIELD_' . $str_i . '_PLAIN']; } else { $map['FIELD_' . $str_i . '_PURE'] = $field['effective_value_pure']; } $map['_FIELD_' . $str_id . '_PURE'] = &$map['FIELD_' . $str_i . '_PURE']; | ||||
Tags | Type: Performance | ||||
Time estimation (hours) | 7 | ||||
Sponsorship open | |||||
|
If this is implemented we can remove the no_catalogue_field_assembly* hidden options. |
|
This isn't really necessary now, as 0002502 created an automatic remover for unused Tempcode parameters before things enter the block cache. It doesn't matter than unneeded parameters are generated prior to the cache being populated, as normative performance is after the cache is full. This is a cleaner solution. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-04-05 17:25 | Chris Graham | New Issue | |
2016-04-05 17:25 | Chris Graham | Tag Attached: Type: Performance | |
2016-04-24 20:37 | Chris Graham | Additional Information Updated | View Revisions |
2016-04-26 04:47 | Chris Graham | Note Added: 0003751 | |
2016-06-26 22:45 | Chris Graham | Note Added: 0004067 | |
2016-06-26 22:45 | Chris Graham | Status | non-assigned => closed |
2016-06-26 22:45 | Chris Graham | Assigned To | => Chris Graham |
2016-06-26 22:45 | Chris Graham | Resolution | open => won't fix |