loolwsd/test/TileCacheTests.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
New commits: commit 65ed424199d6e25d9151d0c619237b947f86b412 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sun May 22 19:00:57 2016 -0400 loolwsd: new tile performance test Change-Id: I08d477ec5f04de9f82c49263f35ebbf38a968f31 Reviewed-on: https://gerrit.libreoffice.org/25335 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/test/TileCacheTests.cpp b/loolwsd/test/TileCacheTests.cpp index e8524b3..f4bc0d8 100644 --- a/loolwsd/test/TileCacheTests.cpp +++ b/loolwsd/test/TileCacheTests.cpp @@ -32,6 +32,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(testSimple); CPPUNIT_TEST(testSimpleCombine); + CPPUNIT_TEST(testPerformance); CPPUNIT_TEST(testUnresponsiveClient); CPPUNIT_TEST(testClientPartImpress); CPPUNIT_TEST(testClientPartCalc); @@ -44,6 +45,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture void testSimple(); void testSimpleCombine(); + void testPerformance(); void testUnresponsiveClient(); void testClientPartImpress(); void testClientPartCalc(); @@ -195,6 +197,34 @@ void TileCacheTests::testSimpleCombine() socket2.shutdown(); } +void TileCacheTests::testPerformance() +{ + std::string documentPath, documentURL; + getDocumentPathAndURL("hello.odt", documentPath, documentURL); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL); + + auto socket = *loadDocAndGetSocket(_uri, documentURL, "tile-performance "); + getResponseMessage(socket, "invalidatetiles:"); + + Poco::Timestamp timestamp; + for (auto x = 0; x < 5; ++x) + { + sendTextFrame(socket, "tilecombine part=0 width=256 height=256 tileposx=0,3840,7680,11520,0,3840,7680,11520 tileposy=0,0,0,0,3840,3840,3840,3840 tilewidth=3840 tileheight=3840"); + for (auto i = 0; i < 8; ++i) + { + auto tile = getResponseMessage(socket, "tile:", "tile-performance "); + CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile.empty()); + } + } + + std::cerr << "Tile rendering roundtrip for 5 x 8 tiles combined: " << timestamp.elapsed() / 1000. + << " ms. Per-tilecombine: " << timestamp.elapsed() / (1000. * 5) + << " ms. Per-tile: " << timestamp.elapsed() / (1000. * 5 * 8) << "ms." + << std::endl; + + socket.shutdown(); +} + void TileCacheTests::testUnresponsiveClient() { std::string documentPath, documentURL; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits