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

Reuse the array key of mimetypes #13438

Merged
merged 1 commit into from Jan 19, 2015
Merged

Reuse the array key of mimetypes #13438

merged 1 commit into from Jan 19, 2015

Conversation

LukasReschke
Copy link
Member

This function is called a lot of times and was really slow before due to not reusing the same array.

Previously when it was called 500'000 times it took about 2seconds, now we're down to 0.2 seconds on my local machine.

Ref #13434

This function is called a lot of times and was really slow before due to not reusing the same array.

Previously when it was called 500'000 times it took about 2seconds, now we're down to 0.2 seconds on my local machine.

Ref #13434
@scrutinizer-notifier
Copy link

A new inspection was created.

@ghost
Copy link

ghost commented Jan 18, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/7188/
👍 Test PASSed. 👍

@RobinMcCorkell
Copy link
Member

Metrics? But I can see why this is important, so 👍

@LukasReschke
Copy link
Member Author

Well, there is not much sense in a metric that shows exactly the same as my original comment says ;-)

@MorrisJobke
Copy link
Contributor

fpalm30c3

I will test this.

@MorrisJobke
Copy link
Contributor

I uploaded my sample files collection that consists of many different file types. All mimetypes are fine there. So 👍 from my side.

@DeepDiver1975 @karlitschek Low change of breaking stuff, but huge performance impact (as it even can be cached in PHPs OPCache ;)) I would rate for a merge into master before ownCloud 8

@karlitschek
Copy link
Contributor

looks good 👍

@@ -28,6 +28,75 @@ class OC_Helper {
private static $mimetypeIcons = array();
private static $mimetypeDetector;
private static $templateManager;
/** @var string[] */
private static $mimeTypeAlias = array(
Copy link
Member

Choose a reason for hiding this comment

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

I'd really prefer to get this out of the helper class - but this is something for 8.1

@DeepDiver1975 DeepDiver1975 added this to the 8.0-current milestone Jan 19, 2015
@DeepDiver1975
Copy link
Member

👍

DeepDiver1975 added a commit that referenced this pull request Jan 19, 2015
Reuse the array key of mimetypes
@DeepDiver1975 DeepDiver1975 merged commit 4fcfedb into master Jan 19, 2015
@DeepDiver1975 DeepDiver1975 deleted the cache-the-array branch January 19, 2015 07:40
@lock lock bot locked as resolved and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants