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

Performance: do not fetch extra post data unless needed #87

Closed
levb opened this issue Jan 31, 2020 · 2 comments · Fixed by #105
Closed

Performance: do not fetch extra post data unless needed #87

levb opened this issue Jan 31, 2020 · 2 comments · Fixed by #105
Assignees
Labels
Difficulty/2:Medium Medium ticket Help Wanted Community help wanted Tech/Go Type/Enhancement New feature or improvement of existing feature

Comments

@levb
Copy link
Contributor

levb commented Jan 31, 2020

Presently, processing each post autolink goes back to the server to get the Channel and Team names for it, to match the scope. https://github.com/mattermost/mattermost-plugin-autolink/blob/0c286d8baa27c03834c2240c0e20fd518b4ec83d/server/autolinkplugin/plugin.go#L104-L117

  1. These should be requested lazily so if no links have Scope defined, there's no perf impact.
  2. Long term we should consider a new hook MessageWillBePostedEx that would contain extended metadata (channel and team names in this case) and will not require extra roundtrips. cc @lieut-data
  3. Another long-term performance improvement here would be limiting the Scope to perform only exact matches on teams and channels, rather than the present contains (by keyword). Maybe we add new fields Channel and Team that are exact matches? This would allow pre-resolving all references on Config and comparing by ID, avoiding the extra per-message RPCs.
@levb levb added Enhancement Help Wanted Community help wanted Up For Grabs Ready for help from the community. Removed when someone volunteers Difficulty/2:Medium Medium ticket Tech/Go labels Jan 31, 2020
@lieut-data
Copy link
Contributor

@ali-farooq0, this will be an interesting case to think through with respect to autolink performance efforts. Knowing the RPC overhead, in particular, will influence where in the pipeline we should optimize.

@hanzei hanzei added Type/Enhancement New feature or improvement of existing feature and removed Enhancement labels Mar 7, 2020
@mo2menelzeiny
Copy link
Contributor

Hello @levb @hanzei
I would love to work on this

@levb levb removed the Up For Grabs Ready for help from the community. Removed when someone volunteers label Apr 6, 2020
@hanzei hanzei unassigned levb Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty/2:Medium Medium ticket Help Wanted Community help wanted Tech/Go Type/Enhancement New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants