sysalto / ReactiveReports

Reactive Reports - a framework developed in Scala, designed for generating reports from code.
Other
16 stars 4 forks source link

Perfomance issue with large fonts #16

Closed antonkarputkin closed 4 years ago

antonkarputkin commented 4 years ago

Large Unicode fonts might be parsed tens of seconds. This is caused by converting hMetrics to list at line 13 of com.sysalto.render.util.fonts.parsers.otf.Hmtx.scala; list in scala is a linked list, but it is being accessed by index inside a loop at line 57 of com.sysalto.render.util.fonts.parsers.otf.OtfFontParser.scala, which is O(n^2). Removing .toList would fix the issue.

sysalto commented 4 years ago

I fixed the issue in commit https://github.com/sysalto/ReactiveReports/commit/76f8c5359315a059b927f961ec881d7bb67874be