Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323401

Summary: Typing in a PHP file is laggy and eats CPU
Product: z_Archived Reporter: Henry C. Gernhardt, III <hgernhardt>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: kenxle, mauromol, paul.serby, silviya, zulus
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Henry C. Gernhardt, III CLA 2010-08-23 11:27:15 EDT
Build Identifier: 20100617-1415

When editing a PHP file (and this appears to _only_ affect PHP files), the screen is slow to update and I am often typing ahead of the text.  Also, I have noticed that my CPU usage spikes, sometimes reaching 100% while I am typing.  In watching the output of top, I note that the java process will report greater than 100% cpu usage in Irix mode after I have paused in typing.

Reproducible: Always

Steps to Reproduce:
1. Open a PHP file
2. Start typing
Comment 1 kenxle CLA 2010-08-31 12:02:10 EDT
I experience this same problem, and have isolated it to specific settings. 

The lag occurs when the structured text editor setting "Enable folding" is on. Even then the problem only occurs when opening and closing html tags. For example, when I type "<a" the editor immediately hangs. 

I'm using:
-OS X 10.6.4
-Eclipse for PHP Developers
Build id: 20100218-1602 (Galileo)

HTH
-Ken
Comment 2 Paul Serby CLA 2011-04-20 10:47:31 EDT
I have the same problem as Henry C. Gernhardt, III. I don't believe that kenxle@hotmail.com is having the same problem as I had the problem on Galileo. 

I am now on:

-OS X 10.6.4
- Version: Helios Service Release 2
- Build id: 20110301-1815
- Eclipse IDE for PHP Developers 1.3.2.20110301-1807

and have the following problem.

Create a new txt file.

Run my finger along the numbers on my keyboard

1234567890

By the time my finger leaves the zero key the text is on screen.

Same for .js, .css, .html

If I create a PHP file then do the same number sequence it is very laggy and takes at least 3 seconds to output.

A few years ago this happened to a worst extent on large files. But now this is happening on 2 line files.

Because of this my entire mac development team are switching to textmate and vim.

On Linux this also happens but it is slightly fast.

On Windows 7 the lag is hardly noticeable.

This is a more than a P3 issue for Mac users and needs attention.
Comment 3 Paul Serby CLA 2011-04-20 11:44:52 EDT
Obviously there are problems with the font metrics performance.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=320135

I have tried with both 'Show Whitespace' on and off and I still get poor performance.
Comment 4 Paul Serby CLA 2011-04-20 11:57:28 EDT
Typing outside the php block is fast.

----

1234567890 // Slow!!!!
?>
1234567890 // Super speedy!
<?php
1234567890 // Slow :-( !!!!
?>

----


and with 'Show whitespace' off it is slightly faster. Maybe?
Comment 5 Paul Serby CLA 2011-04-20 11:58:52 EDT
If you add 10 lines of PHP the response gets slower.
Comment 6 Paul Serby CLA 2011-04-20 12:02:02 EDT
Also turning, auto complete, highlight matching, auto close etc has no effect.

Opening the file in a text editor within Eclipse everything is very fast.
Comment 7 Dawid Pakula CLA 2014-02-18 16:02:03 EST
Is this problem still exists on latest eclipse/PDT?
Comment 8 Dawid Pakula CLA 2014-05-30 15:38:21 EDT
PDT 3.3 have a lot editor performance improvements. 

If this bug still exists, please reopen with more informations.
Comment 9 Sylvia Tancheva CLA 2015-06-01 08:49:58 EDT
This bug is quite old and there haven't been comments on it for more than a year. As Dawid says a lot of improvements were made since then on performance issues.
Closing the bug