Commit graph

23 commits

Author SHA1 Message Date
Ashod Nakashian
5905c3b3f2 loolwsd: combine single rows only
Combining as much as possible is too aggressive and
seems to harm performance where large areas are
invalidated during editing (f.e. inserting text
at the begining of a paragraph).

With this patch we only combine a single row at a
time. This is reasonable since rows almost always are
invalidated when a line is edited. Larger blocks
are typically less important.

This is experimental and might get reverted if proves
to harm more than help.

Change-Id: I6e4420e07a031805c1e2729b3f32de580ae4806e
Reviewed-on: https://gerrit.libreoffice.org/29289
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:51:05 +00:00
Ashod Nakashian
e9a7f8c6c6 loolwsd: split tilecombined in the TileQueue
Delaying the splitting maximizes the chances
that we will deduplicate and combine them
in the queue optimally.

Change-Id: Ib721fe7596de7ad5d34159949fe75f16e861eb24
Reviewed-on: https://gerrit.libreoffice.org/29287
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:50:17 +00:00
Ashod Nakashian
552a8a6f9b loolwsd: removed BasicTileQueue which served no purpose
Change-Id: If0a768dcc71e6a9957f52abe1f44b242ab3c836f
Reviewed-on: https://gerrit.libreoffice.org/29285
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:49:36 +00:00
Jan Holesovsky
4e7ba53a2b Prioritize the views where the cursor moved the most recently.
Even the order of the views matters when the editing is happening.

Change-Id: Id0868a8198f9fa955512fccba57fa063eab46e8c
Reviewed-on: https://gerrit.libreoffice.org/29284
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:48:49 +00:00
Jan Holesovsky
c97ebfc585 Prioritize the tile requests when extracting from the TileQueue.
When putting tiles into the queue, do only the de-duplication,
reprioritization is better at the get() time - no need to keep shuffling
the priorities according to the cursor moves etc. all the time.

The tile combination then does the rest of the work for us :-)

Change-Id: I100c433dd3b24228d1ca8e4c89891635db1115c1
Reviewed-on: https://gerrit.libreoffice.org/29283
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-26 02:46:59 +00:00
Miklos Vajna
0b488905f9 MessageQueue: it and payload are the same, keep only one of them
It confuses me that 'it' is a reference, while 'payload' is a value, so
even if payload is a const value that's never written, it's not OK to
change it to a reference, as the underlying memory is released by the
in-between erase() call.

Change-Id: I05ad0f64e3eeedf847b74a6fadff610fc7469aa1
2016-09-23 09:04:23 +02:00
Ashod Nakashian
1641f756b2 loolwsd: improved logging
Change-Id: I1a1559754efcb0614875dc76ae0637ed6dc1ba77
Reviewed-on: https://gerrit.libreoffice.org/29160
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:32:48 +00:00
Ashod Nakashian
0326aa4304 loolwsd: cancel individual tiles
Change-Id: I18faee319fc12de2151460afbb054b8509578579
Reviewed-on: https://gerrit.libreoffice.org/29120
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:15:30 +00:00
Ashod Nakashian
9e5df31cbb loolwsd: make sure to combine all contiguous tiles
Change-Id: If65e2ff53f593015ba7df23b6943a711c36550de
Reviewed-on: https://gerrit.libreoffice.org/29119
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:14:41 +00:00
Ashod Nakashian
e9f37433d7 loolwsd: combine tiles before rendering to reduce latency
Change-Id: I5af2d2a9ddf3b5a3db5bc5f0835687d7cae5b17c
Reviewed-on: https://gerrit.libreoffice.org/29115
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 04:59:49 +00:00
Ashod Nakashian
c01629ab2a loolwsd: only prioritize tile messages and not tilecombine
Change-Id: Ia292e5b499dd4409dc3a672e4d5360c868d6c71f
2016-09-14 23:20:12 +01:00
Ashod Nakashian
ece87da287 loolwsd: tile prioritization per view cursor
Change-Id: I1410b64982ac2db04e5a47d744a95b8d2eab5f7e
2016-09-14 23:19:38 +01:00
Miklos Vajna
74a29c4ee4 MessageQueue: avoid allocation of unnecessary temporary strings
Change-Id: I9162407020d84d0c92c9d1c6dfab806c67f3b873
2016-09-13 08:41:51 +02:00
Ashod Nakashian
2663f9b63f loolwsd: replace old tile requests with more recent ones
A new queue with own thread now processes tile requests
so we have a chance to cull backlogged tile requests
that have since been invalidated.

This reduces load on the server significantly, especially
with multiple view at different zoom levels, and very fast
typing.

Change-Id: I6599939cd363dc71c30187f40d542aa37260dc56
Reviewed-on: https://gerrit.libreoffice.org/28607
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-01 20:47:10 +00:00
Miklos Vajna
30d90d6b96 loolwsd: using range-based loops is more readable here
Change-Id: I9533c74dbcd6622a01b21096109edc3b27e797e3
2016-04-28 08:44:01 +02:00
Miklos Vajna
78308db763 loolwsd: remaining 'unnecessary copy' fixes
Change-Id: I138e8473a002a15aae7752136950bb905a21fb1f
2016-04-27 14:58:33 +02:00
Miklos Vajna
89f79a1bf4 MessageQueue: moving a local object in a return statement prevents copy elision
As pointed out by clang -Wpessimizing-move.
2016-03-29 13:36:30 +02:00
Jan Holesovsky
9e180171c2 WaE: Shadowed variable. 2016-03-29 12:42:45 +02:00
Ashod Nakashian
69b4f42d3c loolwsd: preparing MessageQueue for vector<char> payload
Change-Id: I30bf7b4c641f4363790587ddc8ba8fb2bf9d269a
Reviewed-on: https://gerrit.libreoffice.org/23582
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 02:46:54 +00:00
Henry Castro
e0241b1825 loolwsd: Added remove_if to MessageQueue
Change-Id: If4e72796eb39ee66e7604cf67688329fc94d9539
Reviewed-on: https://gerrit.libreoffice.org/20900
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2015-12-23 17:09:48 +00:00
Jan Holesovsky
dacd176c84 loolwsd: We wanted to call the _impl() version.
This was in preparation for a more complex Queue; maybe we should just remove
the non-needed _impl() versions again (?)
2015-12-17 18:50:00 +01:00
Miklos Vajna
2bb596a256 loolwsd: coding style
If README says "spaces, not tabs" and "braces go on separate lines",
then be consistent about it before it gets normal to not respect those
rules.
2015-11-24 09:43:17 +01:00
Jan Holesovsky
6a1477d8a9 loolwsd: Specialize the MessageQueue a bit.
Introduce a bit of hierarchy there, at some stage we'll want to re-order the
tile requests a bit so that it works better for collaborative editing; for the
moment, removing the duplicate entries is enough.
2015-11-09 11:54:09 +01:00