Skip to content

Helper cache#3779

Merged
MGatner merged 2 commits into
codeigniter4:developfrom
MGatner:helper-cache
Oct 16, 2020
Merged

Helper cache#3779
MGatner merged 2 commits into
codeigniter4:developfrom
MGatner:helper-cache

Conversation

@MGatner

@MGatner MGatner commented Oct 15, 2020

Copy link
Copy Markdown
Member

Description
Adds a local static cache of helpers that have already been loaded, so multiple calls to the same file with helper() won't result in duplicate filesystem searches.

Bonus: This sped up tests on CommonFunctionTest.php by 7 seconds (30s -> 20s) so will likely help overall test time!

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • n/a User guide updated
  • Conforms to style guide

@michalsn michalsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh... I didn't realize we didn't cache helpers. Nicely done. Tests speed increased noticeably.

Coveralls is getting annoying.

@MGatner MGatner merged commit 3ffdca6 into codeigniter4:develop Oct 16, 2020
@MGatner MGatner deleted the helper-cache branch November 28, 2020 18:46
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.

2 participants