-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug 63620] Fix GUI freeze when viewing response body with long lines #694
Conversation
6af6f78
to
dd9e05f
Compare
Codecov Report
@@ Coverage Diff @@
## master #694 +/- ##
============================================
- Coverage 55.59% 55.54% -0.05%
- Complexity 10336 10345 +9
============================================
Files 1059 1061 +2
Lines 65053 65209 +156
Branches 7401 7432 +31
============================================
+ Hits 36163 36221 +58
- Misses 26340 26431 +91
- Partials 2550 2557 +7
Continue to review full report at Codecov.
|
34d45af
to
17a050d
Compare
src/components/src/main/java/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
Outdated
Show resolved
Hide resolved
src/jorphan/src/main/java/org/apache/jorphan/util/StringWrap.java
Outdated
Show resolved
Hide resolved
455a2cc
to
cb8a120
Compare
Looks really good to me. What keeps you from merging? |
Thank you for the review and for yet another test case. my setup: macOS Monterey 12.1, Java 11.0.13. With Nimbus LaF it is really fast when browsing "view results tree". It is still usable, so we might want to merge the change and investigate the slowness with Darklaf later, however, I don't quite understand why Darklaf is slower since the thread spends time in It might be the font selected by Darklaf is somehow slower. Here's a stacktrace:
/cc @weisJ |
I suspect the performance hit is coming from font kerning. Try to set the font to |
@weisJ , thanks for the hint. Initially, I thought the issue was ligature-related, however, ligatures are disabled by default. I completely forgot about the kerning. As I deactivated kerning the UI became much better, and the delays are like ~1sec when displaying 10MiB. On my machine, the kerning becomes noticeable at 9 and 10 scales (10-20KiB), so I am inclined to either completely disable the kerning for the results tab or automatically disable it after a certain threshold (e.g. after 10KiB). |
Shouldn't this setting be default in jmeter installation ?
…On Thu, Feb 3, 2022, 00:35 Jannis Weis ***@***.***> wrote:
I suspect the performance hit is coming from font kerning. Try to set the
font to comp.setFont(comp.getFont().derive(Collections.singletonMap(TextAttribute.KERNING,
0)))
—
Reply to this email directly, view it on GitHub
<#694 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQDSRBODMYVZTUPT46RPTUZGWR3ANCNFSM5MEDVDXQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Which setting? |
comp.setFont(comp.getFont().derive(Collections.singletonMap(TextAttribute.KERNING,
0)))
Please see mail below.
…On Sat, Feb 5, 2022, 19:27 Vladimir Sitnikov ***@***.***> wrote:
Which setting?
—
Reply to this email directly, view it on GitHub
<#694 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQDSWVB4JFQCLFHVLNDR3UZVMXDANCNFSM5MEDVDXQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The idea is to disable kerning for long texts by default |
Very good.
Thank you.
…On Sat, Feb 5, 2022, 19:39 Vladimir Sitnikov ***@***.***> wrote:
The idea is to disable kerning for long texts by default
—
Reply to this email directly, view it on GitHub
<#694 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQDSQRUXMDAWY7LBCWGZLUZVOD3ANCNFSM5MEDVDXQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
314b7a0
to
79fe7cd
Compare
I've added a feature to automatically disable kerning when text length exceeds 10K, and now I can click through all the results. |
GUI gets unresponsive when the response contains long lines (e.g lines exceeding 100K chars). The workaround is to add artificial line breaks. We try to break on word boundaries first, and if not possible, we break on char boundaries (e.g. large chunks of base64 data). view.results.tree.max_line_size=110000 (defaults to 110K) view.results.tree.soft_wrap_line_size=100000 (defaults to max_line_size/1.1) CPU spin trace looks as follows: "AWT-EventQue... ... at sun.font.GlyphLayout.layout(Unknown Source) ... at java.awt.font.TextLine.<init>(Unknown Source) at java.awt.font.TextMeasurer.makeTextLineOnRange(Unknown Source) at java.awt.font.TextMeasurer.getLayout(Unknown Source) ... at javax.swing.text.JTextComponent.setDocument(Unknown Source) at org.apache.jmeter.visualizers.SamplerResultTab.setTextOptimized(SamplerResultTab.java:695) ...
The treshold can be configured via text.kerning.max_document_size
Im using macos and 5.5 version - If i click on View Results tree when the request sent has body like 5k/10k records then the UI is getting frozen. Not sure if this fix covers this use case too ? @vlsi |
GUI gets unresponsive when the response contains long lines (e.g lines exceeding 100K chars).
The workaround is to add artificial line breaks.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63620
We try to break on word boundaries first, and if not possible,
we break on char boundaries (e.g. large chunks of base64 data).
For the reference, using zero-width space does not solve the problem, so I use
\n
for breaking lines.CPU spin trace looks as follows: