Open peter-citeright opened 3 weeks ago
Hi @peter-citeright Thanks for reporting this issue. Could you tell us under what conditions might the pending duration surpass 700 milliseconds? I run this code many times, it doesn't take up to 700ms.
Were you testing on mac? And we have other syncs running in parallel. For example:
async function onSelectionChanged() {
try {
await Word.run(async (context) => {
const document = context.document;
const selection = document.getSelection();
const contentControl = selection.parentContentControlOrNullObject;
contentControl.load("id");
document.contentControls.load("items");
await context.sync();
// ... do some processing
});
} catch (err) {
if (process.env.NEXT_PUBLIC_APP_ENV !== "dev") {
captureException(err);
}
}
}
Hi @peter-citeright The issue may be caused by several reasons, such as machine config. we'll take a look and report back if we have a suggestion for you. We unfortunately have no timelines to share at this point. It'll be helpful if you could share us some log, Thanks.
Provide required information needed to triage your issue
Your Environment
Expected behavior
Current behavior
Steps to reproduce
The only pending statement is:
["var root = context.root;"]
yet at some points it takes up to 700ms. We do have other context syncs in other run functions in the document so not sure if that's affecting the performance, but what should we do to improve overall performance?
This 700ms overhead makes things worse especially when it comes to using
insertHtml
for content controls. Each insertion takes about 2000-3000ms.