-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
only parse info.xml once #30188
only parse info.xml once #30188
Conversation
Codecov Report
@@ Coverage Diff @@
## master #30188 +/- ##
============================================
+ Coverage 64.81% 64.83% +0.02%
+ Complexity 18378 18319 -59
============================================
Files 1199 1198 -1
Lines 69583 69558 -25
Branches 1282 1282
============================================
- Hits 45099 45098 -1
+ Misses 24111 24087 -24
Partials 373 373
Continue to review full report at Codecov.
|
b064dad
to
88f431a
Compare
fa4b82e
to
a0c381d
Compare
8c7a171
to
c6af155
Compare
:O interesting, 👍 for idea, let's see when you finish the PR |
Testing it and runs fine and faster than b4 |
yay, finally found the problem, now really ready to review |
I remember @DeepDiver1975 telling me never to add lines in legacy and move the code to new code base. So you think this extra effort is possible here ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added few comments to better understand this part of code
lib/private/legacy/app.php
Outdated
if ($path) { | ||
public static function getAppInfo($appId, $isPath = false) { | ||
if(empty($appId)) { | ||
return null; // TODO explode? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TO-DO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So TODO needs to stay there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a reminder, for anyone looking at the code, yes
Let me see if I can move this to AppManager |
fcd8571
to
4dbddb5
Compare
c2442ed
to
b4d37ae
Compare
Some more thoughts on this:
|
@patrickjahns the cache is invalidated if an info.xml etag changes. see https://github.com/owncloud/core/pull/30188/files#diff-8fa91b147fc76360cb3cfca41a1db57dR406 |
@butonic please recheck for outstanding comments/tasks so someone else can take over. |
b4d37ae
to
5e54ea0
Compare
@PVince81 I rebased. All comments should be addressed. Please take over. Fingers crossed about the testsuite. |
@VicDeo please takeover as you're already familiar with the matter |
lib/private/App/AppManager.php
Outdated
$appInfo = \OC_App::getAppInfo($appId); | ||
if ($appInfo === null) { | ||
return null; | ||
if (empty($appId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty
is not good for strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well ... ok ... i did not want to check for null, false and emptystring ... and an app id with 0 or an empty array is wrong as well .. so i think this kind of makes sense here ... maybe do if (!is_string($appId) || $appId === '')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one of rare cases when strict comparison sucks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I went with (!is_string($appId) || $appId === '')
Great job in general, just two minor things |
024caa0
to
678f54d
Compare
@VicDeo both resolved |
678f54d
to
d3fe459
Compare
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
d3fe459
to
2f5212d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed is_string
to \is_string
to pass CI. The rest is good.
@PVince81 backport? |
Stable10: #34482 |
I was profiling the preview stuff and noticed that we are parsing all info.xml files twice per request.
Top left: current state
Top rigth: cache in local variable per request for file as well.
Bottom left: This PR, cold cache
Bottom right: cached info.xml
x6 speed increase
Related: #30190