Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace elgg_view vars parameter with object + lazy views rendering (Trac #4922) #4922

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 6 comments

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/4922 on 42891195-03-22 by trac user srokap, assigned to unknown.

Elgg version: 1.8

I was wondering about possibilities of optimizing elgg view system and I had few ideas such as

  • replace copied for each vars array with object (implementing ArrayObject - we need compatibility here) to try to save amount of used memory and processing
  • approach above allows to easily remove config, user, url and similar parameters from vars to make it much lighter (we can be still backward compatible)
  • lazy and sequential output rendering (to allow streaming output) and render views only when used
  • possibly some smart view-level caching policy based on parameters changes

I was experimenting slightly with possibility of using such object, and only problem I have now is situation when ElggViewVars object is used as parameter of array_merge function or similar. It works in case of casting values $vars = array_merge($default, (array)$vars). Ideal would be to migrate usage to sth $vars->mergeAsDefault($defaults);. I'll post my experimental branch in a minute.

@elgg-gitbot
Copy link
Author

trac user srokap wrote on 42891220-06-26

Experimental working version #439

@elgg-gitbot
Copy link
Author

trac user srokap wrote on 42891225-04-24

I'm not sure, but probably lazy loading of views could be done by returning object from elgg_view that has proper __toString() magic method that does actual rendering. Anybody has some experience with that method?

@elgg-gitbot
Copy link
Author

trac user srokap wrote on 42891265-10-18

Correction, lazy views loading seems to work fine. Proof of concept included in PR.

@jdalsem
Copy link
Member

jdalsem commented Oct 30, 2014

i'm still interested in improving the views system especially if there are ideas about some fancy caching as views are probably becoming the biggest burden on the system, so if @Srokap still has some ideas lying around, maybe this ticket can be revived...

@ewinslow
Copy link
Contributor

@jdalsem See my PR #7070 for my attempt at refreshing the views system implementation.

Feedback on how this might work with the improvements you want to make would be valuable.

@jdalsem
Copy link
Member

jdalsem commented Oct 27, 2017

closing this issue as there is no progress regarding this experimental approach

@jdalsem jdalsem closed this as completed Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants