Skip to content

[word] (Performance) Add a sample highlighting the perf benefits of the correlated objects pattern #959

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

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

AlexJerabek
Copy link
Contributor

This article has samples that show the benefits of avoiding context.sync calls in a loop. This PR adds the sample for the correlated objects pattern (and the less performant variant).

Open to feedback on the folder/playlist placement. as well as other notes on the sample code itself.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • view-prod/word.json: Language not supported
  • view/word.json: Language not supported
Comments suppressed due to low confidence (2)

samples/word/90-scenarios/correlated-objects-pattern.yaml:112

  • [nitpick] The function name 'tryCatch' is too generic. It should be renamed to 'executeWithErrorHandling' to make its purpose clearer.
async function tryCatch(callback) {

playlists/word.yaml:559

  • Replace backticks around context.sync with single quotes to ensure compatibility with all YAML parsers.
description: Shows the performance benefits of avoiding `context.sync` calls in a loop.

Copy link
Contributor

@ElizabethSamuel-MSFT ElizabethSamuel-MSFT left a comment

Choose a reason for hiding this comment

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

Looks good. Are you planning to link to this sample from the article, maybe in the "See also" section or areas where the fast/slow patterns are discussed?

@AlexJerabek
Copy link
Contributor Author

Looks good. Are you planning to link to this sample from the article, maybe in the "See also" section or areas where the fast/slow patterns are discussed?

Yes! I will add text that encourages readers to follow along with in Script Lab. Just wanted the links first.

@AlexJerabek AlexJerabek merged commit a034dfc into main Jan 31, 2025
1 check passed
@AlexJerabek AlexJerabek deleted the AlexJ-CorObjects branch January 31, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants