Bug 281771 - KBlocks runs very slow and eats 100% of one cpu core with Egyptian theme.
Summary: KBlocks runs very slow and eats 100% of one cpu core with Egyptian theme.
Status: RESOLVED WORKSFORME
Alias: None
Product: kblocks
Classification: Applications
Component: general (show other bugs)
Version: 0.3.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Zhongjie Cai
URL:
Keywords:
: 300762 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-10 21:02 UTC by Nikita Skovoroda
Modified: 2020-10-24 10:21 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
smooth (799.77 KB, image/png)
2011-09-13 14:37 UTC, Mikhail Sidorov
Details
laggy (803.72 KB, image/png)
2011-09-13 14:38 UTC, Mikhail Sidorov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Skovoroda 2011-09-10 21:02:47 UTC
Version:           0.3.1 (using Devel) 
OS:                Linux

This is not a direct duplicate of #203064, i am talking about windowed KBlocks and only one theme. This happens only with Egyptian theme, Oxygen theme is fast. The reason behind both bugs might be the same.

Bug was tested by several people with different hardware/software/drivers configuration (Russain: http://www.linux.org.ru/forum/talks/6727242 ).

KBlocks eats 100% of one core of my AMD Phenom II X4 945 and has a very slow response time. That's just not normal for a tetris game.

Tested with native/raster graphicssystem.

There is a workaround for Egyptian theme to work smooth, see steps to reproduce.

Reproducible: Always

Steps to Reproduce:
1) Open KBlocks. Do not start the game, set theme to Oxygen, do not start the game, close KBlocks.
2) Open KBlocks (the theme is Oxygen now). Do not start the game, set theme to Egyptian. Start the game. There are no lags, cpu usage is ok.
3) Open KBlocks (the theme is Egyptian now). Start the game. There are lags, the game is slow and eats 100% of a cpu core.
4) Any further launches of KBlocks (with Egyptian theme) → lags.
5) Starting the game with Oxygen theme is always smooth.


Expected Results:  
The game (tetris) should always run smooth on every supplied theme.

Everything is ok when using Oxygen theme.
Comment 1 Nikita Skovoroda 2011-09-10 21:04:14 UTC
s/Russain/Russian/, sorry.
Comment 2 Nikita Skovoroda 2011-09-10 21:06:26 UTC
Steps to reproduce were checked by three different people (including me) with different software/hardware configuration.
Comment 3 Nikita Skovoroda 2011-09-10 21:19:21 UTC
> 2) Open KBlocks (the theme is Oxygen now). Do not start the game, set theme to
Egyptian. Start the game. There are no lags, cpu usage is ok.

Close KBlocks after step 2, of course. It should be:

2) Open KBlocks (the theme is Oxygen now). Do not start the game, set theme to
Egyptian. Start the game. There are no lags, cpu usage is ok. Close KBlocks.
Comment 4 Daniele Cocca 2011-09-10 21:20:18 UTC
I can confirm that this bug is present on my system too, and that the supplied "workaround" works for me.
Comment 5 Alexander Meshcheryakov 2011-09-13 07:31:46 UTC
*** This bug has been confirmed by popular vote. ***
Comment 6 Mikhail Sidorov 2011-09-13 14:37:28 UTC
Created attachment 63618 [details]
smooth
Comment 7 Mikhail Sidorov 2011-09-13 14:38:02 UTC
Created attachment 63619 [details]
laggy
Comment 8 Mikhail Sidorov 2011-09-13 14:39:42 UTC
I can confirm this but it seems that this applies for Oxygen theme as well. If you run KBlocks and start playing immediately you'll get lags, but if you go to Settings and change theme before playing everything will be smooth.
I have also noticed that the game looks different at these two cases. You can see that on the screens above. First screen shows «smooth» case and the second is how «laggy» looks like. It seems that lags are caused by some scaling which is not performed after changing theme.
Comment 9 Nikita Skovoroda 2011-10-16 00:55:28 UTC
I can't reproduce this (lags) anymore on 4.8 (git).

Can anybody confirm?

But there is a different bug: kblocks theme is shrinked after start until a window resize.
Comment 10 Ivan Sorokin 2011-10-16 12:12:11 UTC
Confirm. After update to ubuntu 11.10 (kde 4.7.1) kblocks works much faster.
Comment 11 Ivan Sorokin 2011-10-16 12:19:09 UTC
> Confirm. After update to ubuntu 11.10 (kde 4.7.1) kblocks works much faster.

But! The game "Human vs. AI" is unbelivable slow when playing fullscreen. When playing in small window everything is ok.
Comment 12 sdl_init 2011-11-04 13:06:38 UTC
 With raster grapicssystem (run as 'kblocks --graphicssystem raster'),  fast enough but cpu usage of this wanderful softwore is not acceptable yet.
Comment 13 Nikita Skovoroda 2012-05-22 15:25:25 UTC
I can reproduce the high cpu usage (100% of one Phenom core) on KDE 4.8.3 + Qt 4.8.1, using raster graphicssystem.
Comment 14 Nikita Skovoroda 2012-05-22 15:29:52 UTC
No, wait. Not 100% of one core, but only 1/3 of one core, and that depends on resolution used. But that's still way to much.
Comment 15 Christoph Feck 2012-05-28 21:43:29 UTC
*** Bug 300762 has been marked as a duplicate of this bug. ***
Comment 16 Nikita Skovoroda 2012-08-18 19:16:33 UTC
«kblocks --graphicssystem native» is still laggy and unresposive.
kblocks — 84% of one core¸ X — 65% of one core.
Comment 17 Nikita Skovoroda 2013-07-08 13:05:16 UTC
Most time is spent in QSvgTinyDocument::draw(QPainter*, QString const&, QRectF const&) (not directly inside that method, but nested).

Aren't svg images cached as pixmaps?
Comment 18 Christoph Feck 2013-07-19 01:15:03 UTC
The way Qt does the caching is weird. I debugged it years ago, after facing the same slowness in KTuberling (see bug 203742). From what I remember, sizes must not change between creating the item and rendering it.
Comment 19 Nikita Skovoroda 2015-03-16 00:16:03 UTC
In fact, everything is ok from the CPU usage side with kf5 port.
The block disappearing animation is laggy (especially when there are several rows).
The style size is still buggy: when the game is started, everyting is small, an a minor window resize scretches the style to fill the whole window.
Comment 20 Nikita Skovoroda 2016-06-22 13:33:01 UTC
Closing, the size issue is different from this and should probably be filed as a separate bug.
Comment 21 Abel 2020-10-24 10:21:37 UTC
I dont want the instalation in my computer. I want to take it's far way from here!