Bug 72163 - 100% CPU usage when editing files with large parts with the same color
Summary: 100% CPU usage when editing files with large parts with the same color
Status: RESOLVED DUPLICATE of bug 63000
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-08 17:03 UTC by FACORAT Fabrice
Modified: 2004-02-25 18:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description FACORAT Fabrice 2004-01-08 17:03:58 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

I'm developping code for PHP and PostgreSQL. When i wrote some procedure for PostreSQL ( in .sql files ), you put the code of the procedure between ' '. The code could be very long long and take many lines ( for example more than 50 lines if the procedure is comlex ) and you may have many procedure.
I notice that for example when I was editing a file with about 700 lines, each time i was typing a character, quanta was eating 100% CPU during a long time ( proportionnal to the numbers of line ) and was frozen during this time. So i end up typing one character evry 10 secondes : completly unusable. i order to avoid this, i need to split my fonctions across many files and use file having less than 400-450 lines.
This may be symptomatic of an optimisation issue concerning the highlighting code.

on top of that, maybe quanta should have support for postgresSQL procedure so that it no longer consider all the code between ' ' as a string.

here you have doc concerning PL/PgSQL structure :
http://www.postgresql.org/docs/current/static/plpgsql-structure.html


code example example ( a short one ) :

CREATE TYPE compteur_res AS ( r0_day INT4, r0_month INT4, r0_year INT4);

CREATE or REPLACE FUNCTION compteur() RETURNS compteur_res AS
'
DECLARE
	r compteur_res%ROWTYPE;
BEGIN
	SELECT INTO r.r0_day DISTINCT COUNT(id_dossier)  FROM fiche_dossier WHERE dossier.date_creation = CURRENT_DATE;
	SELECT INTO r.r0_month DISTINCT COUNT(id_dossier)  FROM fiche_dossier WHERE  EXTRACT( MONTH FROM dossier.date_creation) = EXTRACT( MONTH FROM CURRENT_DATE ) AND EXTRACT( year FROM dossier.date_creation) = EXTRACT( year FROM CURRENT_DATE );
	SELECT INTO r.r0_year DISTINCT COUNT(id_dossier)  FROM fiche_dossier WHERE EXTRACT( year FROM dossier.date_creation) = EXTRACT( year FROM CURRENT_DATE );
	RETURN r;
END;
' language 'plpgsql';
Comment 1 S. Burmeister 2004-02-17 20:38:16 UTC
I can second this, BUT in my case it is not related to colours but to the position of the cursor in the file. If I enter a text at the bottom of the skript, everything is fine. However if I try the same at the top of the file quanta is stalled for a long time. My php-skript is about 1500 lines long.
Comment 2 András Manţia 2004-02-17 20:56:38 UTC
If possible, try to check out the kdewebdev module from the CVS. It contains 
the latest development version of Quanta and this bug is fixed. The fix needs 
some testing and this is why I haven't closed the bug yet. Take a look also 
at bug #63000.

Comment 3 András Manţia 2004-02-25 18:18:29 UTC
Mark as the duplicate of #63000.

*** This bug has been marked as a duplicate of 63000 ***