[prev in list] [next in list] [prev in thread] [next in thread] 

List:       quanta
Subject:    Re: [Quanta] Quanta and CPU/Memory consumption
From:       Andras Mantia <amantia () kde ! org>
Date:       2008-05-25 19:14:01
Message-ID: 200805252214.02389.amantia () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi,

On Monday 19 May 2008, James Ellis wrote:
> Hi
>
> I'm not sure about anyone else but I find Quanta's CPU and memory
> usage to be pretty extreme, especially on startup. 

Would be nice to see some figures. As we know [*] top is not a good tool 
on Linux to measure memory consumption, but I use it to see memory 
increase/decrease during time. 

I started Quanta without any project, and it shows  199m  41m  25m (VIRT 
RES SHR). This is little more than Kate (171, 29, 21). After I load the 
project that holds all the kdewebdev.org web pages: 202m  44m  25m
I find this increase minimal.
After loading my huge test html file (700KB, 12000 lines): 234m  71m  26m 
. Now indeed the memory usage increased, but this was an extreme file. Th 
e increase is partly because of katepart (the editor) and partly because 
of the Quanta internals (the node tree).
Showing the structure tree for this file increases some more: 253m  90m  
26m. Unfortunately even after closing the file, top shows the same 
amount. But there isn't that huge leak (I don't say there isn't any, see 
below), as if you reopen again the same file, you get: 253m  91m  26m.
I had to close/open several times the same file to see +1m increase 
again.

So I'd like to know what do you see there (sorry if you already told 
that, I still have some mails to read).

> Out of all the KDE
> apps that I use it's the one that slows down the system the most, by
> a fair margin. To the point where there is a noticeable lag when
> typing this message between key stroked and the key appearing on the
> page.

That usually indicates that the parser reparses continuously the whole 
file as it cannot find the area that was changed. Normally I'd say to give 
us the file for testing, but I don't do that as sincerely the parser used 
in Quanta 3 is dead, it is not used anymore in Quanta4 and we don't have 
the resources to do big changes in Quanta3. 

> It's most noticeable on startup when a project is being scanned -
> it's less of an issue with small projects which would point to a
> scaling issue. I regularly see CPU usage between 50 and 99% and
> memory usage generally outstrips Xorg which usually runs at 6% or so.

As the other thread shows, the project parsing is fast. I'd suspect the 
code parser to be slow. Anyway, try to configure quanta to not open the 
last opened files in the project and see how it works.

> Once Quanta has finished it's startup dance, system load returns to
> normal.
> Doing an strace on the process reveals what looks to be Quanta doing
> a stat on every file in the project.

That is interesting. Quanta stats the files, but I don't remember doing 
it on opening, but before uploading (there you can see that it is slow 
before the upload dialog shows and marks which files need to be 
uploaded).

> So, I guess the big questions are
> - is this cpu and memory usage really needed?

The answer is: probably yes, otherwise it wouldn't use it. ;) CPU and 
memory usage was important everytime, as I usually tested Quanta also on 
a low-end system (550Mhz, 192MB ram). I found to be usable there as 
well. I admit that my tests may not reflect the usage of all users, but 
for what I did was ok.

> - Does Quanta need to stat every file in the project on startup?

Now I checked the code. It indeed stats every file, if it is a local 
project, to check if it exists or not. If not, it is removed from the 
project file. The drawbacks of storing the file names in the project 
file... Is it needed? Probably it isn't mandatory, but it is a nice 
feature. I could suggest to you one thing, if you are not afraid of 
touching the code and compile the source: comment out
projectlist.cpp, line 87 until line 100, the check if it is a local file, 
and if it is the check if the file exists or not.

> - Couldn't it just read the XML project file and put a representation
> of that in the file tree? 
This is what it does.

Andras
-- 
 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

["signature.asc" (application/pgp-signature)]

_______________________________________________
Quanta mailing list
Quanta@mail.kde.org
https://mail.kde.org/mailman/listinfo/quanta


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic