Commit Graph

49 Commits (1b6af5e28d50c3a1152981537a385dfbb9a049a9)

Author SHA1 Message Date
Michael Meeks 1b6af5e28d killpoco: remove lots of redundant JSON includes.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I976c5b8d6763cbbf0ee5cadfa2f7335ec719fe85
2024-04-25 09:06:13 +02:00
Michael Meeks 57de384bb2 dumpState should summarize MessageQueue and TileQueue messages.
Change-Id: I86bff39dd26491dc1cdc781f7e2ce3bbcd9859bd
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-21 12:57:11 +00:00
Ashod Nakashian 61cf7b9601 wsd: clean up unused header includes
Clang-tidy recommendation driven header
include clean-up.

Change-Id: I30c32866b7798e70df0463ee6bc7a0bcc3de5049
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-08 08:38:48 +01:00
Michael Meeks 7183a3d3de spdx: improve machine and human readability of headers.
Change-Id: Ice934380029bf27054e830fffc07a5d037d1430f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Michael Meeks 12e0830b1b Kill canceltiles support completely.
This stopped working well a long time ago, and is already disabled
on the coolwsd side, so dung out the rest of the code & docs on this.

Change-Id: I2e0b73fe9780e16c3cc74ae3a38ae6b04434717a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-06-22 09:35:22 +01:00
Caolán McNamara 53e4209377 Resolves: #6514 disable noop 'canceltiles'
Given that all messages that can have "ver=" in them will also have
"nviewid=", "oldwid=" and "wid=" then the "id=" search is always
successful and this loop doesn't achieve anything. Disable this for now
and later either drop canceltiles or repair it to do something

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I085bd18f05561df3a542eb14ceb4744b228f4621
2023-06-13 20:04:57 +01:00
Caolán McNamara 81b2cbe63a perf: avoid creating strings by using string_view
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ibffa35d40ee9839635cbd37be8cdc9c69b834504
2023-06-13 09:59:59 +02:00
Caolán McNamara bb617b90aa Related: #6514 removeCallbackDuplicate only needs up to 4 tokens
rearrange so we can use the tokens as they are generated and
can end tokenization early as we find we don't need any more

from:

|--74.39%--SvpSalInstance::CheckTimeout
|          SalTimer::CallCallback (inlined)
|          Scheduler::CallbackTaskScheduling
|          |
|          |--63.01%--desktop::CallbackFlushHandler::Invoke
|          |          |
|          |           --62.92%--Document::ViewCallback
|          |                     |
|          |                     |--62.11%--MessageQueue::put
|          |                     |          |
|          |                     |          |--61.95%--MessageQueue::put
|          |                     |          |          TileQueue::put_impl
|          |                     |          |          |
|          |                     |          |          |--61.51%--TileQueue::removeCallbackDuplicate

to:

|--44.61%--SvpSalInstance::CheckTimeout
|          SalTimer::CallCallback (inlined)
|          Scheduler::CallbackTaskScheduling
|          |
|          |--21.23%--desktop::CallbackFlushHandler::Invoke
|          |          |
|          |          |--20.75%--Document::ViewCallback
|          |          |          |
|          |          |          |--19.33%--MessageQueue::put
|          |          |          |          |
|          |          |          |          |--19.17%--MessageQueue::put
|          |          |          |          |          TileQueue::put_impl
|          |          |          |          |          |
|          |          |          |          |          |--18.69%--TileQueue::removeCallbackDuplicate

seen with 25 simultaneous joins to a local instance

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Iea4de188521f7cd8039d6ab60e9c52209fc3154d
2023-06-07 08:54:27 +01:00
Szymon Kłos 7043365475 masterpage: get & set optional mode parameter for tiles (server side)
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I756e3d515c86a635cfa9db81106848ee3dcf684a
2022-09-19 15:18:23 +02:00
Michael Meeks 0ae5a8ae5e MessageQueue: don't insert duplicates of tiles into TileCombined.
Apparently for some subset of messages (presumably on busy queues)
we have been double compressing the same tiles ...

Change-Id: I79aea4f2162caa8a5b5660c13ae2cae855d90755
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-10 10:10:05 +01:00
Ashod Nakashian 480fb7b931 wsd: move tokenizer helpers into StringVector
In an attempt to reduce the size of Util.{c,h}pp
which has grown to contain all sorts of unrelated
helpers, we move StringVector helpers into
the StringVector.{c,h}pp files.

This makes the code better organized.

Change-Id: I152f341606807ae66253415b951bc9f89b09df57
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-12 07:39:07 -04:00
Andras Timar f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Gökhan Karabulut 7f736a9bc4 Improve state dump
Add `dumpState` methods to `TileQueue`, `PngCache`, `ThreadPool` classes
and call them from Document::dumpState method within kit.Kit.cpp.
Because `dumpState` method of `_websocketHandler` is protected,
currently we can't dump its internals.

Also dump the other members of the `Document` class. Note that as
`_lastMemStatsTime` is never used, we don't dump it. It seems we could
simply delete it.

Signed-off-by: Gökhan Karabulut <gokhanettin@gmail.com>
Change-Id: Ia89b7fff41eaf475c7a09a644c0eb523b72cf97d
2021-05-13 09:29:35 +01:00
Ashod Nakashian 05ec2a68d6 wsd: copy strings only when needed
Change-Id: Ia63d5f9526bbcd295a9a5d18990a4f1ab744a5b2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-08 22:49:53 -05:00
Andras Timar 0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +02:00
Gabriel Masei 95c9c58f5b remove .uno:ModifiedStatus message from deduplication mechanism
This fixes the following issue in Online:

When a save is performed while a cell is still edited the save icon
does not reflect the correct state of the document: it shows that
the document is dirty although it is not.

This works only in conjunction with the following commit from core:
-lok: remove .uno:ModifiedStatus message from deduplication mechanism-

Change-Id: Ie671097ef2b206c8801a5bdfc2b908ee260951fb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103084
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-09-21 14:51:10 +02:00
Ashod Nakashian 39d34cbab4 wsd: match LOK callback type as integer
String comparisons are costly and much
less readable. Now we have a fast switch
with LOK_CALLBACK enum values.

Change-Id: Icc24b91b174cd9bbb7e0d64039df080c0a4338f2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96375
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-07-02 21:49:31 +02:00
Ashod Nakashian 4a57654d88 wsd: avoid unnecessary string ops
Change-Id: Ia5a6f2d7a260edaf8bb294693be12a434a2c30fe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96376
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-06-23 06:41:58 +02:00
Ashod Nakashian d2d0492245 wsd: move LOOLProtocol::tokenize to Util::tokenize
The tokenizer(s) are more generic than the protocol
logic, and are used from contexts that don't involve
the protocol as such.

Change-Id: Ie8c256bf11a91e466bff794021f41603c9596a7f
2020-06-02 18:03:36 +01:00
Ashod Nakashian 224ef08c7f wsd: single-char string literals -> char
More readable and typically more efficient.

Change-Id: I9bd5bfc91f4ac255bb8ae0987708fb8b56b398f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95285
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-06-02 01:31:26 +02:00
Michael Meeks 3e4ac31c7c killpoco: remove WebSocket includes from a couple of places.
Change-Id: I06740cd978bec8e6a74beb8ed9ef8f4f970a2535
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92470
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-18 18:29:04 +02:00
Miklos Vajna a7d3efdd4e Introduce StringVector::equals()
Allows comparing tokens with C strings without a heap allocation. Do the
same when comparing two tokens from two different StringVectors.

And use it at all places where operator ==() has an argument, which is a
StringVector::operator []() result.

Change-Id: Id36eff96767ab99b235ecbd12fb14446a3efa869
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90201
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-03-09 09:46:33 +01:00
Miklos Vajna b8bd1990aa Rework LOOLProtocol::tokenize() to return a StringVector object
The bulk of this commit just changes std::vector<std::string> to
StringVector when we deal with tokens from a websocket message.

The less boring part of it is the new StringVector class, which is a
wrapper around std::vector<std::string>, and provides the same API,
except that operator[] returns a string, not a string&, and this allows
returning an empty string in case that prevents reading past the end of
the underlying array.

This means in case client code forgets to check size() before invoking
operator[], we don't crash. (See the ~3 previous commits which fixed
such crashes.)

Later the ctor could be changed to take a single underlying string to
avoid lots of tiny allocations, that's not yet done in this commit.

Change-Id: I8a6082143a8ac0b65824f574b32104d7889c184f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89687
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-28 16:07:56 +01:00
Jan Holesovsky efa293290c killpoco: Remove trivial StringTokenizer uses from some files.
Particularly those used on Android...

Change-Id: I47bf9692f5e99ba30140d698558472201168a198
Reviewed-on: https://gerrit.libreoffice.org/82302
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-11-08 22:21:31 +01:00
Michael Meeks f2c6facb29 Don't combine tiles a long way from each other.
We currently combine only horizontally, but ctrl-right arrow in
calc can throw us to the other side of the sheet, creating a very
large area to re-render.

Change-Id: I7125ab815e3de1296b3af32632626005eeee0ec9
2019-07-26 10:12:00 +01:00
Tor Lillqvist 235c9b8a60 Use getAbbreviatedMessage() for its intended purpose
Don't log a potentially very long message in its entirety.

Change-Id: I01fbf76465d99bbab117d1dcacc6c7239a1da518
2018-11-29 01:07:03 +02:00
Miklos Vajna d52cf35418 MessageQueueBase: make members private
Change-Id: I65360bc23475b25b2c626ea75186e8863fc74b8f
2018-11-16 09:06:17 +01:00
Miklos Vajna 0122ba2a6a CursorPosition: make members private 2018-11-15 09:07:38 +01:00
Tor Lillqvist b7a42bd9d1 Add a FIXME 2018-10-19 02:02:54 +03:00
Miklos Vajna 9eacfe4fcb common: spell out non-trivial autos to improve readability
Change-Id: Id13bc0e48cec845f5b05171128be5b4efc05c6bc
2018-02-07 10:18:12 +01:00
Pranav Kant f63858433b loplugin:includeform
Change-Id: Ib62a7aa61062f00698aa3e8a144438de5c57e53d
2017-12-20 21:21:05 +05:30
Jan Holesovsky 1585cbdb6b Merge document size changes callbacks in the message queue.
Change-Id: I1a540b17f2a72c374568db834a30b814878e9032
2017-04-07 12:13:45 +02:00
Jan Holesovsky 67586d3fdb Don't bloat the message queue with unprocessed status indicator changes.
Change-Id: I87f254a94183b5a97cfb1e4eb49ddea7f88258bf
2017-04-07 11:30:12 +02:00
Michael Meeks 0eaef6c896 config.h - get includes right: must always be the first include. 2017-03-10 10:47:43 +01:00
Miklos Vajna 18f40e89e1 common: avoid unnecessary value parameter in MessageQueue
Change-Id: I4cefc2658eea75091219e534db25f5ab5877c0c4
2017-02-06 09:30:44 +01:00
Ashod Nakashian 1ba7c0209a wsd: cosmetics
Change-Id: I58a9e579e228d7b4a1e1b5686988aeff8da9922f
Reviewed-on: https://gerrit.libreoffice.org/33674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:13 +00:00
Jan Holesovsky 9d4eab1aba Re-introduce the TileQueue depth logging.
Change-Id: I025aa9745d1b0a3306930323764957c6d84a0966
2017-01-27 18:32:01 +01:00
Jan Holesovsky 545e2a2abe Fix a size check.
Change-Id: I509d12dcde6f56a2a7a9ee244e721d8028dec501
2017-01-26 11:49:29 +01:00
Jan Holesovsky c44f7b8a76 Revert "loolwsd: improved MessageQueue"
Now we don't get a situation where there would be a tremendous amount of
invalidates & tile render requests piled in the queue, so we can do it
deterministic again.

The only thing that could potentially pile in the queue are the keypresses
events sent from the clients, but that is a different problem anyway.

This reverts commit c326228774.

Change-Id: I98e199eab0187bf5f47ce322ac1b1b2e3b976b85
2017-01-26 11:49:29 +01:00
Jan Holesovsky 3c9f4e1e1f Deduplicate & remove obsolete invalidations from the queue.
There's no point in trying to paint something we know will be obsolete anyway.

Change-Id: I14f61f389b114f2cda1f97e5223b31fa2f01b06c
2017-01-26 11:49:29 +01:00
Jan Holesovsky f77253f4f8 Deduplicate the .uno: command state changes too.
Change-Id: Iaf9204d39d90cb9289d279e35a4609fa68c2cce8
2017-01-26 11:49:29 +01:00
Jan Holesovsky 1b9e34a3f9 Squash the invalidation messages coming from various view into one.
Change-Id: I65f7e4eb0b82a8c76eef372548ad3298ac70bdd7
2017-01-26 11:49:29 +01:00
Jan Holesovsky 60a3d717cb Remove obsolete cursor positions from the message queue.
Change-Id: Ie54aa4a475f0a55baaf6a40a99ed341c8f941a04
2017-01-26 11:49:29 +01:00
Ashod Nakashian 09fe0b689a wsd: templatized MessageQueue
Change-Id: Ieb6b6c289d8348cafc82041e6e719409cc329edd
Reviewed-on: https://gerrit.libreoffice.org/32919
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-10 05:40:37 +00:00
Ashod Nakashian c326228774 loolwsd: improved MessageQueue
Tiles no longer hog the queue ahead of all else.

We now give priority to callback events, so clients
get to know the document state sooner.

Since tiles take long to render, an equal time
is given to non-tiles (capped at 100ms).

Finally, Impress preview tiles are given
the lowest priority and rendered only when
the queue is drained.

Change-Id: I922c1e11200e5675f50d86b83baee1588cbbf66f
Reviewed-on: https://gerrit.libreoffice.org/31394
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-30 04:42:40 +00:00
Ashod Nakashian f4dd9c1e11 loolwsd: use vector instead of deque for MessageQueue
Change-Id: I879d248e54748916b30c64874ddc237fb662ac11
Reviewed-on: https://gerrit.libreoffice.org/31289
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:57:10 +00:00
Ashod Nakashian a8f3263132 loolwsd: use more efficient matchPrefix
Change-Id: I6f34b314295335270ff4da2827517d818c6a62ab
Reviewed-on: https://gerrit.libreoffice.org/31285
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:53:04 +00:00
Michael Meeks c1a398977f Adapt makefiles, includes etc. to new locations. 2016-11-25 09:58:57 +00:00
Michael Meeks cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00