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
calc perf: Note listing #7334
Comments
There is a ridiculous amount of this search going on; I assume that the result is: 1697730362525 INCOMING: commandvalues: { "commentsPos": [ { "id": 1, "tab": 0, "cellRange": "0 0 0 0"}]} I seem to get this when switching tab, but worse - when I move between cells with the arrow keys (perhaps just when scrolling the window) - that's a pretty heinous cost to pay for this small operation - if that is indeed what's going on :-) @caolanm I would assume there is some legacy fetching or pushing going on there from when notes were pushed not in their entirity but cropped to the viewpane or (?). |
Seems like we do far too much work as we extend the document - by moving into 'blank space' - that's when we emit (from the client) this OUTGOING: commandvalues command=.uno:ViewAnnotationsPosition which is something of an anomaly: much of the data we need is helpfully pushed: 1697732170923 OUTGOING: key type=up char=0 key=1031 ... getting page down ... 1697732147269 INCOMING: invalidateheader: all |
We probably need to re-visit these:
commit ef53761
commit 647556b
in light of: commit 4d7f7d6
I expect we would do well to fetch comment positions either just for the current sheet - which should save a lot of time; but we should prolly check the mobile UI for comments (?) - and we should re-visit when we need to refresh comments. Particularly when scrolling and/or expanding the sheet area - we shouldn't look at what we're fetching. Finally - we should -probably- push this thing from the online/kit side as we do for these other settings, rather than taking another round-trip to fetch it later :-) |
I'm working on this, with the integration of the "comment positions are now cell addresses" I turned the addresses to positions quite early and kept thing similar to how they were. We should be able to keep them as addresses and work on those and then I think we can drop the round-trip to "update positions". |
Seems like the micro-optimization we did got this cost down to ~2.5% in the 2nd calc profile here: If we get some easy wins, we should prolly move on to the other costs in doc_setView - which is 15%+ =) Thanks ! =) |
right, turns out that removing these calls to make core to send the "full updates" of comments reveals that when we add/remove a comment then the little update that core sends has the comment id quoted while the comment ids in the "full update" are not quoted, so they are then not found. Which is a known problem of boost::property_tree::ptree used for the little update vs the tools::JsonWriter used for the full updates. So, https://gerrit.libreoffice.org/c/core/+/158560 as the prerequisite for the remainder |
we know where they are by cell addresses, so defer getting the screen positions until we need them and we don't need to get core to trigger recalculating them. When we redraw the comments after the new geometry arrives then we can place them via the address. When adding a new note we want to know the range of the potentially merged cells we are inserting into. #7334 https://gerrit.libreoffice.org/c/core/+/158560 needs to be applied to solve the problem described there that becomes apparent when this is in place. Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I3228dc8fa8d47ba4e796e50427c125d7f78fe5fc
which does not conform to JSON standard and means that added/deleted comment ids are strings and not numbers as created by the related getPostIts found during: CollaboraOnline/online#7334 where if the regular updating of comments via getPostIts doesn't happen then deleting/adding comments doesn't appear to work boost bug report found as: https://svn.boost.org/trac/boost/ticket/9721 https://marc.info/?l=boost-bugs&m=139351272302586&w=2 Change-Id: I0c43588ce1f92b83fb82c582f0c2c18a6672dc54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158560 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
which does not conform to JSON standard and means that added/deleted comment ids are strings and not numbers as created by the related getPostIts found during: CollaboraOnline/online#7334 where if the regular updating of comments via getPostIts doesn't happen then deleting/adding comments doesn't appear to work boost bug report found as: https://svn.boost.org/trac/boost/ticket/9721 https://marc.info/?l=boost-bugs&m=139351272302586&w=2 Change-Id: I0c43588ce1f92b83fb82c582f0c2c18a6672dc54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158561 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
we know where they are by cell addresses, so defer getting the screen positions until we need them and we don't need to get core to trigger recalculating them. When we redraw the comments after the new geometry arrives then we can place them via the address. When adding a new note we want to know the range of the potentially merged cells we are inserting into. #7334 https://gerrit.libreoffice.org/c/core/+/158560 needs to be applied to solve the problem described there that becomes apparent when this is in place. Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I3228dc8fa8d47ba4e796e50427c125d7f78fe5fc
we know where they are by cell addresses, so defer getting the screen positions until we need them and we don't need to get core to trigger recalculating them. When we redraw the comments after the new geometry arrives then we can place them via the address. When adding a new note we want to know the range of the potentially merged cells we are inserting into. #7334 https://gerrit.libreoffice.org/c/core/+/158560 needs to be applied to solve the problem described there that becomes apparent when this is in place. Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I3228dc8fa8d47ba4e796e50427c125d7f78fe5fc
when a row/column is inserted/deleted, etc the cell the comments are associated with changes, so broadcast that change to the clients. CollaboraOnline/online#7334 Change-Id: I8a3e5fc151b6ba99e68b32c3fe8804de9ba2baf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158720 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
when a row/column is inserted/deleted, etc the cell the comments are associated with changes, so broadcast that change to the clients. CollaboraOnline/online#7334 Change-Id: I8a3e5fc151b6ba99e68b32c3fe8804de9ba2baf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158718 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
we know where they are by cell addresses, so defer getting the screen positions until we need them and we don't need to get core to trigger recalculating them. When we redraw the comments after the new geometry arrives then we can place them via the address. When adding a new note we want to know the range of the potentially merged cells we are inserting into. #7334 https://gerrit.libreoffice.org/c/core/+/158560 needs to be applied to solve the problem described there that becomes apparent when this is in place. Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I3228dc8fa8d47ba4e796e50427c125d7f78fe5fc
we know where they are by cell addresses, so defer getting the screen positions until we need them and we don't need to get core to trigger recalculating them. When we redraw the comments after the new geometry arrives then we can place them via the address. When adding a new note we want to know the range of the potentially merged cells we are inserting into. CollaboraOnline/online#7334 https://gerrit.libreoffice.org/c/core/+/158560 needs to be applied to solve the problem described there that becomes apparent when this is in place. Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I3228dc8fa8d47ba4e796e50427c125d7f78fe5fc
I think we can close this, always more that can be done, but the major issue seems resolved now |
which does not conform to JSON standard and means that added/deleted comment ids are strings and not numbers as created by the related getPostIts found during: CollaboraOnline/online#7334 where if the regular updating of comments via getPostIts doesn't happen then deleting/adding comments doesn't appear to work boost bug report found as: https://svn.boost.org/trac/boost/ticket/9721 https://marc.info/?l=boost-bugs&m=139351272302586&w=2 Change-Id: I0c43588ce1f92b83fb82c582f0c2c18a6672dc54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158560 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
when a row/column is inserted/deleted, etc the cell the comments are associated with changes, so broadcast that change to the clients. CollaboraOnline/online#7334 Change-Id: I8a3e5fc151b6ba99e68b32c3fe8804de9ba2baf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158718 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
From this week's calc flamegraph:
https://user-images.githubusercontent.com/833656/271274520-6345ee72-2a06-402e-a12c-72bd8d49df8d.svg
Shows a chunk of time when users join the sheet is interrogating the whole document as to whether notes are present:
6% of the time - is searching in empty columns far outside the range of the sheet that contains data I expect - in order to see if those columns have notes - inevitably they do not. 16000 is a lot of columns to check to see if there is something there - when there really isn't almost all the time.
I wonder if we should tweak our implementation to shrink the real sheet column and row count to something more reasonable - and then expand that on user interaction: adding row/columns with some '+' button, or pasting into them in some way (?) though that's a bigger pain.
Failing that, having and maintaining some 'last note column' or other better data-structure for notes than columnar storage might be helpful.
The text was updated successfully, but these errors were encountered: