DO NOT REPLY [Bug 32612] - [PATCH] refactoring of knuth line breaking code.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32612. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32612 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2005-03-08 16:05 --- Applied. This was long due and it helps me while preparing for page breaking. Reference in the mailing list archives: http://marc.theaimsgroup.com/?t=11026228562r=1w=2 -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
Re: Refactoring of knuth line breaking code.
Finn Bock wrote: I've been playing around with the knuth line breaking code and made a slight refactoring of it. [...] These improvements could also be applied to the existing code, so I think the more interesting point is the quality of the refactoring job. I think this is a very good patch, and it could be applied as it is now: my last changes introduced a first fit algorithm used if the Knuth's one failed, but your re-starting strategy seems much better. Regards Luca
DO NOT REPLY [Bug 32612] New: - [PATCH] refactoring of knuth line breaking code.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32612. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32612 Summary: [PATCH] refactoring of knuth line breaking code. Product: Fop Version: 1.0dev Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: page-master/layout AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] This patch refactor the knuth line breaking code in its own class and multiple smaller methods. The patch also contain several performance improvements to the knuth line breaking code. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 32612] - [PATCH] refactoring of knuth line breaking code.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32612. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32612 --- Additional Comments From [EMAIL PROTECTED] 2004-12-09 21:02 --- Created an attachment (id=13712) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=13712action=view) Unified diff against HEAD. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
Refactoring of knuth line breaking code.
Hi, I've been playing around with the knuth line breaking code and made a slight refactoring of it. The result is 38% faster for START align, 78% faster for CENTER align and 12% for JUSTIFY align. Meassured using 'time' command, jdk1.4.2_03, -Xmx2 and a rough edition of Sherlock Holmes from the the Gutenberg project: http://apache.org/~bckfnn/advsh12s.fo http://apache.org/~bckfnn/advsh12c.fo http://apache.org/~bckfnn/advsh12j.fo (s=start, c=center, j=justify alignment) The patch is here: http://issues.apache.org/bugzilla/show_bug.cgi?id=32612 The performance improvement comes from: - Using -INFINITE_RATIO when there is too little shrink in a line for an element to fit. - Reuse the BestRecords instance instead of creating an instance for each line * for each element. - Using ArrayList instead of LinkedList. - Avoiding the indexOf calls on Paragraph. - Use '*' instead of Math.pow() for calculating demerit. - Split activeList into an array indexed by line and nodes within a line linked together. These improvements could also be applied to the existing code, so I think the more interesting point is the quality of the refactoring job. I guess that I have moved away from a faithful implementation of Knuth's algorithm, but I think the result is more in line with common java code. Opinions? regards, finn