Performance problem
Closed this issue ยท 10 comments
I executed some tests, and it locked the GUI for 155 seconds
"AWT-EventQueue-0 14.1#IU-140.2110.5, eap:true" prio=0 tid=0x0 nid=0x0 runnable
java.lang.Thread.State: RUNNABLE
at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3694)
at java.util.regex.Pattern$Curly.match0(Pattern.java:4158)
at java.util.regex.Pattern$Curly.match(Pattern.java:4132)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3694)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
at java.util.regex.Pattern$Start.match(Pattern.java:3408)
at java.util.regex.Matcher.search(Matcher.java:1199)
at java.util.regex.Matcher.find(Matcher.java:592)
at awesome.console.AwesomeLinkFilter.getResultItemsFile(AwesomeLinkFilter.java:78)
at awesome.console.AwesomeLinkFilter.applyFilter(AwesomeLinkFilter.java:41)
at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:62)
at com.intellij.execution.impl.EditorHyperlinkSupport.highlightHyperlinks(EditorHyperlinkSupport.java:268)
at com.intellij.execution.impl.ConsoleViewImpl.a(ConsoleViewImpl.java:974)
at com.intellij.execution.impl.ConsoleViewImpl.a(ConsoleViewImpl.java:750)
at com.intellij.execution.impl.ConsoleViewImpl.access$4500(ConsoleViewImpl.java:92)
at com.intellij.execution.impl.ConsoleViewImpl$MyClearRunnable.doRun(ConsoleViewImpl.java:1868)
at com.intellij.execution.impl.ConsoleViewImpl$MyFlushRunnable.run(ConsoleViewImpl.java:1833)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1$1.run(Alarm.java:345)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:741)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:576)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:383)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
all dumps: https://www.dropbox.com/s/lgw8ksk97jimsnx/20150206-124659-155.rar?dl=0
Do you want also yourkit cpu profile?
it would be easier to attach your test rather then 8MB of stacktraces.
How many lines per second are you outputting and how does the lines look like?
Yeah it was kinda hard with to find it with everything locked :-)
It gets stucked on 2 lines which are 53000 chars long with the format of org.apache.commons.lang.builder.ReflectionToStringBuilder#toString.
You should substring the line to like 200 chars before you match it.
5300 chars in a single line is kind of insane ๐
Thanks for the heads-up related to that massively long line!!!
cutting it at a fixed amount of 200 chars is strange, however we will push out an update soon to mitigate your problem and make it work for you.
On a "long" term i think it would be a better way to provide some kind of configuration for that.
I don't like fixed magic numbers in the code which are not configurable by the end-user ๐
thanks for report and heads-up on the solution ๐
Yeah just make some configuration for it, like I did in Grep Console, I hope you use that plugin. :)
@krasa 200 seems a little bit too less, would a limit of 512 chars also fit your performance needs before we release a configurable version in the future?
I guess that could be fine.
@krasa can you verify that the published 0.1337.3 temporarily resolves your issue with dead IntelliJ?
the fix is in commit da5ac9e
After a huge amount of tests we tried going with 1024 char chunk, several reproducible tests are now passing without a dead IntelliJ.
Later (as mentioned above) we will include configuration for this and also chunk-wise highlighting (which also seems to mitigate the problem [so it seems only regex related when a single-long-line-chunk is used] but we did not wanted to push that before the weekend without even more tests)
if you verify that your case works fine now i will close this issue and revisit it later one we push the configuration.
Works fine.