APF-Tracker

Adventure PHP Framework Issue Management


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000287Adventure PHP FrameworkCode-Verbesserung // Code improvementpublic2016-03-12 13:142016-03-12 16:56
ReporterChristianAchatz 
Assigned ToChristianAchatz 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version3.1 
Target Version3.2Fixed in Version3.2 
Summary0000287: Improve place holder performance
DescriptionSetting place holders within a document directly injects values into a place holder instance (PlaceHolder interface, PlaceHolderTag, LanguageLabelTag) by traversing the DOM tree.

This is time consuming with setting place holders but extremely fast with transformation.

This issue is to find a smart solution to speed up place holder management (setting, transformation).
TagsNo tags attached.
Codereferenz: ([Datei]:[Zeile])
Namespacecore
Attached Files

- Relationships

-  Notes
(0000683)
ChristianAchatz (administrator)
2016-03-12 13:42
edited on: 2016-03-12 14:55

Solution 1:
********
Implementation idea is to introduce a separate field into DomNode and Document to set, get, and delete place holders. Storage to be implemented as simple associative array to speed up access.

Place holders then fetch values from parent object's place holder storage.

Solution 2:
********
Place holders register themselves with the parent document and setting place holders then just needs to run through the registration list to inject values.

(0000684)
ChristianAchatz (administrator)
2016-03-12 14:55

Test results:

Solution 1:
********
- Faster with setting place holders between 190% and 490%
- Interestingly slower with transformation though only array index access between 40% and 46%
- Total speed increase: 62%
- Pro: nicely fits into DomNode and Document API

Solution 2:
********
- Faster with setting place holders between 78% and 360%
- Almost same results than current implementation for transformation
- Total speed increase: 107%
- Con: Integration into rendering process is not intuitive as separate index registration out of the
 parser needs to be implemented. Adding new PlaceHolder tags will then not be covered in case magic is
 not applied to them.

==> Choosing solution 1 as it provides sufficient speed increase and nice API.
(0000685)
ChristianAchatz (administrator)
2016-03-12 14:58

PoC code can be taken from the following URLs:

- Solution 1: https://github.com/AdventurePHP/code/tree/feature-alternative-place-holder-logic [^]
- Solution 2: https://github.com/AdventurePHP/code/tree/feature-alternative-place-holder-logic-2 [^]
(0000686)
ChristianAchatz (administrator)
2016-03-12 16:56

Implementation done. See changes on https://github.com/AdventurePHP/code/commit/37f4cdfcb406eb03c741aeaeaba6fe5e3e73ce52 [^]
 and https://github.com/AdventurePHP/code/commit/5c61a81445f15fe93c9519c9ed1c3fbc690983b7. [^]

- Issue History
Date Modified Username Field Change
2016-03-12 13:14 ChristianAchatz New Issue
2016-03-12 13:14 ChristianAchatz Status new => assigned
2016-03-12 13:14 ChristianAchatz Assigned To => ChristianAchatz
2016-03-12 13:42 ChristianAchatz Note Added: 0000683
2016-03-12 14:55 ChristianAchatz Note Added: 0000684
2016-03-12 14:55 ChristianAchatz Note Edited: 0000683 View Revisions
2016-03-12 14:58 ChristianAchatz Note Added: 0000685
2016-03-12 16:56 ChristianAchatz Note Added: 0000686
2016-03-12 16:56 ChristianAchatz Status assigned => resolved
2016-03-12 16:56 ChristianAchatz Fixed in Version => 3.2
2016-03-12 16:56 ChristianAchatz Resolution open => fixed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker