-
Notifications
You must be signed in to change notification settings - Fork 58
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
Performance: do not fetch extra post data unless needed #105
Performance: do not fetch extra post data unless needed #105
Conversation
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.
Thank you for the contribution! One style suggestion.
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.
Thanks for the contribution @mo2menelzeiny.
Let me understand the overall logic here. We traverse the markdown tree with Inspect
which basically calls passed function for every node(let's say N
nodes). In the function itself for each link
where we have a scope we call the inScope
method. Let's assume we have M
links, this makes O(N*M)
calls of the inScope
(and resolveScope
respectively).
Return values of team.Name
and channel.Name
will be the same for every call. Am I missing something? Why not call resolveScope
method just once before the Inspect
?
@iomodo I don't know how I missed this, you're definitely right. |
refactor contains function and make it more readable
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.
Awesome @mo2menelzeiny !
Just two minor improvements below.
refactor duplicated replace calls
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.
@mo2menelzeiny, Sorry for being pain in the neck, couple more very minor comments below :)
Codecov Report
@@ Coverage Diff @@
## master #105 +/- ##
==========================================
+ Coverage 42.62% 48.09% +5.46%
==========================================
Files 6 6
Lines 563 576 +13
==========================================
+ Hits 240 277 +37
+ Misses 303 282 -21
+ Partials 20 17 -3
Continue to review full report at Codecov.
|
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.
Thanks a lot @mo2menelzeiny ! Great work!
Hey guys, @DHaussermann @levb @iomodo |
@mo2menelzeiny Apologies for the wait, but we are heavily backlogged in QA, and this requires QA verification before it's merged. |
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.
Tested and passed
- Regression tested that scope is applied correctly to Teams and combinations of Teams and Channels
- Tested that scope is correctly applied when added and updated
- Tested that scope rules are correctly applied when updating existing post
- Other brief regression testing.
LGTM!
Sorry for the delay on testing this PR @mo2menelzeiny. Huge thanks for this improvement!
@levb @iomodo @DHaussermann |
Summary
ProcessPosts
Ticket Link
Closes #87