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

Conversation

Projects
None yet
7 participants
@LukasReschke
Copy link
Member

LukasReschke commented Jan 18, 2015

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

Reuse the array key of mimetypes
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

This comment has been minimized.

Copy link

scrutinizer-notifier commented Jan 18, 2015

A new inspection was created.

@owncloud-bot

This comment has been minimized.

Copy link
Contributor

owncloud-bot 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. 👍

@Xenopathic

This comment has been minimized.

Copy link
Member

Xenopathic commented Jan 18, 2015

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

@LukasReschke

This comment has been minimized.

Copy link
Member Author

LukasReschke commented Jan 18, 2015

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

@MorrisJobke

This comment has been minimized.

Copy link
Member

MorrisJobke commented Jan 18, 2015

fpalm30c3

I will test this.

@MorrisJobke

This comment has been minimized.

Copy link
Member

MorrisJobke commented Jan 18, 2015

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

This comment has been minimized.

Copy link
Member

karlitschek commented Jan 19, 2015

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(

This comment has been minimized.

@DeepDiver1975

DeepDiver1975 Jan 19, 2015

Member

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

This comment has been minimized.

Copy link
Member

DeepDiver1975 commented Jan 19, 2015

👍

DeepDiver1975 added a commit that referenced this pull request Jan 19, 2015

Merge pull request #13438 from owncloud/cache-the-array
Reuse the array key of mimetypes

@DeepDiver1975 DeepDiver1975 merged commit 4fcfedb into master Jan 19, 2015

1 check passed

default Merged build finished.
Details

@DeepDiver1975 DeepDiver1975 deleted the cache-the-array branch Jan 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment