OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
689 stars 95 forks source link

Word add-in is giving performance issue in office 2019. #2131

Closed careernavigator closed 8 months ago

careernavigator commented 3 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Issue Summary Word add-in is giving performance issue in office 2019. We have developed a word add-in using office JS, angular 12 & Kendo UI. For cases where it is dealing with the documents, we have observed slow performance in office 2019, but in O365 it works perfectly fine.

Your Environment Platform [PC desktop, Mac, iOS, Office on the web]: PC Desktop Host [Excel, Word, PowerPoint, etc.]: Word Office version number: Microsoft® Word 2019 64-bit Operating System: Windows 10

Expected behavior Word add-in should respond fast in Office 2019 as it works in O365.

Current behavior Word add-in is giving performance issue in office 2019. We are using office js API, content control, angular 12 and kendo UI. For some of the scenarios where we are dealing with the document like adding some values from add-in data grid to the document, and then clicking the embedded link/cell in the document to navigate to respective add-in screen, in such scenarios it is taking lot of time to respond. These scenarios works perfectly fine in O365. There is another scenario where we display the data in kendo grid, we have column filters on the grid, on click of column filters it display all unique data values for that column. The column filter click is also taking time to load the data.

Steps to reproduce

  1. Create a word add-in with office js. Add one data grid on the add-in with some data. Add one Apply button below the grid. On click of this Apply button, it should add that selected value to the document using content control, and it should store the reference as well so that next time when user click on this applied cell in the document, it should navigate the user to add-in data grid screen. Below are the operations being performed in the document when the perf difference occurs:-
  2. when we add some values from add-in to the document, and then if we click on that referenced cell in the document again, it should navigate user to add-in trial balance screen. So the moment user click on referenced cell in the document as shown in the given video, it takes long time to navigate to add-in trial balance screen.
  3. on the add-in , we are using kendo grid. where we have some column filters to filter out the grid data. when user click on the column filter it takes some time to load the filter data. Initially it shows white box for some fraction of seconds, and then it loads the data.

Useful logs Please find the video link given below where we have captured the scenarios where slow performance was observed i.e. when user click on referenced cell in the document which should navigate the user to add-in trial balance screen, second one is click of column filter is taking some time to load the data. Video link- https://github.com/careernavigator/word-add-in/blob/main/Slowness%20in%20Office%202019.mp4

AlexJerabek commented 3 years ago

Hi @careernavigator,

Thank you for reporting this issue. @AbidRahman-MSFT, could you please investigate this?

AbidRahman-MSFT commented 3 years ago

Hey @careernavigator - I wasn't able to view the video that you have linked (it takes me to a empty github repo). Can you share a different link to the video?

Also - is this behavior also reproducible on Web? For eg. if using Word on the Edge browser?

careernavigator commented 3 years ago

Hey @careernavigator - I wasn't able to view the video that you have linked (it takes me to a empty github repo). Can you share a different link to the video?

Also - is this behavior also reproducible on Web? For eg. if using Word on the Edge browser?

@AbidRahman-MSFT I have shared the video separately with you, let me know if you are able to see it. And on word web version/online version, currently we are facing some issue, add-in is giving error in word web on edge.

careernavigator commented 3 years ago

@AlexJerabek @AbidRahman-MSFT Hello, any updates on this issue? please do let me know if any other detail is required on this. Thank you!

AbidRahman-MSFT commented 3 years ago

@careernavigator - can you please share a snippet of the code (preferably so we can reproduce this bug using ScriptLab)? Please share a gist that can reproduce this behavior when running with ScriptLab. That will help us understand what part of the process is causing the delay and which APIs specifically may be an issue.

ShahViral6438 commented 3 years ago

@AbidRahman-MSFT For Point 1 mentioned in the repro steps (clicking on linked cell in document automatically navigates to particular page of word add-in), we are using below API:

Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, (eventArgs: any) => this.clickEventHandlerWord(self));

ShahViral6438 commented 3 years ago

@AbidRahman-MSFT - Please find attached demo project for further analysis.

WordAddInDemoProject.zip

AbidRahman-MSFT commented 3 years ago

We have opened an internal bug (5471576) to help track the investigation. We will keep you updated on any progress. Thank you for the patience.

careernavigator commented 3 years ago

@AbidRahman-MSFT - Any updates on internal bug (5471576) ? Since we have production release in 2 weeks, it would be helpful if we could get a formal answer from product group about this performance issue. Accordingly we can communicate it to the customer.