[MAGNOLIA-6283] AppendableWriter | Making use of the writer API if possible Created: 05/Jul/15  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Magnolia
Component/s: rendering
Affects Version/s: 5.2.7, 5.4
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Daniel Kasmeroglu Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File AppendableWriter.patch     Java Source File AppendableWriterTest.java    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

While investigating a problem my profiler showed up a large amount of String creations. I figured that cause was located in AppendableWriter as it uses an Appendable to write the data.
However often (at least I haven't found a different scenario) the Appendable instance was a Writer itself, so the creation of a String using "new String(..)" basically isn't necessary in most cases.
My patch tests whether the Appendable is a Writer and then uses this Writer directly.



 Comments   
Comment by Daniel Kasmeroglu [ 05/Jul/15 ]

A simple "testcase" which compares the old AppendableWriter with the new one (just not that the new code is named "AppendableWriter2" in here). Just in case someone might need this class (it's basically not necessary)

Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 04:13:02 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.