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

Fix unneeded repetitive filesystem access / checks (e.g. 10,000 in category view) causing performance issue in custom fields feature #17893

Merged
merged 4 commits into from
Oct 18, 2017

Conversation

ggppdk
Copy link
Contributor

@ggppdk ggppdk commented Sep 6, 2017

Pull Request for Issue #17889

This should fix a considerable part of the performance problem reported in #17889

e.g. 25% or 50% or 75% (please note that i have not tested the performance improvement)

Also the above performance improvement is when having --zero-- textareas / editor fields, since these also include a different performance issue which is that of triggering content plugins, in which case you have performance that depends on slow content plugins !!!

Summary of Changes

If you have 10 or more fields per record (e.g. per article)

Then the layouts of fields are checked several thousands of times (in category view) if they exist
and a few hundrends of times in single record view

With this PR every layou is checked only once

Testing Instructions

Custom fields display in frontend works as before

Expected result

The layouts of fields are checked only once if they exist

Actual result

The layouts of fields are checked several thousands of time if they exist

Documentation Changes Required

None

// Return the data
return $types;
// Add to cache and return the data
return $types_cache[$this->_type . $this->_name] = $types;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you split this into 2 lines? I REALLY dislike assignments in return- or if-statements.

@Hackwar
Copy link
Member

Hackwar commented Oct 18, 2017

I have tested this item ✅ successfully on a88108d

I have tested this successfully, however please split up the assignment to the cache and the return statement. For a customer of mine, this was a gigantic speed improvement.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17893.

@Hackwar
Copy link
Member

Hackwar commented Oct 18, 2017

I have tested this item ✅ successfully on 6d59695


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17893.

1 similar comment
@HLeithner
Copy link
Member

I have tested this item ✅ successfully on 6d59695


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17893.

@ghost
Copy link

ghost commented Oct 18, 2017

RTC after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 18, 2017
@mbabker mbabker added this to the Joomla 3.8.2 milestone Oct 18, 2017
@mbabker mbabker merged commit 1c7fc8a into joomla:staging Oct 18, 2017
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 18, 2017
@Hackwar
Copy link
Member

Hackwar commented Oct 18, 2017

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants