layout code: bad performance

ok, it is a very big sourcefile: over 7000 lines and 300kbytes...
BUT... it is in my opinion a bit embarassing that IDEA cannot manage to reformat this file in less than 1 minute...

to reproduce it should be enough to take e.g. the source of JTable,
then setup a codestyle that differs from it, e.g. all braces on new line, etc.
then layout it.
and wait... wait... wait...

7 comments

I would imagine it's not just the mere size of the file that affects the performance, it's the code complexity. I imagine that an excessively deep hierarchy of nested code constructs would affect the performance more than anything else. In any case, I wouldn't apply the word "embarrassing" to describe IDEA's performance in this context. What's embarassing, indeed, is having a source file that contains 9K lines in it. ;)

0

+1

:)

Const@ntine wrote:

I would imagine it's not just the mere size of the file that affects the performance, it's the code complexity. I imagine that an excessively deep hierarchy of nested code constructs would affect the performance more than anything else. In any case, I wouldn't apply the word "embarrassing" to describe IDEA's performance in this context. What's embarassing, indeed, is having a source file that contains 9K lines in it. ;)

0

there exist projects in which not all code is written by yourself ;)
you fire up your super-duper Refactoring IDE just to watch it hang for a few minutes, when you try to reformat some code to be able to read it :)

I cannot believe that the reformatting cannot be done faster - current speed for big files is embarassing for the most intelligent Java IDE.

0

Actually, I have reformatted some awful source files before - a collective work of a whole team of geniuses :) Some were over 3000 lines long (don't recall seeing anything longer than that though...) Even then, it would take IntelliJ about 5 - 8 seconds on a machine with 2 Gig of RAM. Parsing algorithms may need to use quite a bit of memory if they process elaborate, deeply nested structures: a lot of stuff gets cached in memory. So, if your RAM is limited, you may experience what you are describing. In any case, classes that long should not be allowed, and people who code like that should, perhaps, be selling insurance instead, or mowing lawns... :) (Nothing against mowing lawns.)

0

hm, nobody told this to the one who wrote JTable with its 6000 lines of code :)

Well, I use a notebook with 1,8Ghz celeron and 1GB RAM...

Wasn't IDEA meant to be a tool to deal with code that needs refactoring? ;)

0

Michael Damberger <michael.damberger@t-online.de> wrote:

ok, it is a very big sourcefile: over 7000 lines and 300kbytes... BUT...
it is in my opinion a bit embarassing that IDEA cannot manage to reformat
this file in less than 1 minute...


If you think, this is long you should try to reformat a XML file of that
size...

Best,

Dirk Dittert

0

File parsing performance in general is bad. XML parsing is hysterically bad though. I have one 2Mb XML-file and it freezes IDEA for up to 30 seconds just by having it as the current editor. (Which is related to another IDEA bug. I have switched off all dumb automatic file synchronization features, yet it still always synchronizes the currently active editor).

0

Please sign in to leave a comment.