jferard / fastods

A very fast and lightweight (no dependency) library for creating ODS (Open Document Spreadsheet, mainly for Calc) files in Java. It's a Martin Schulz's SimpleODS fork
GNU General Public License v3.0
36 stars 6 forks source link

Improve XMLEscaper #121

Closed jferard closed 6 years ago

jferard commented 6 years ago

First: do a benchmark Second: try to use an array of arrays to store the replacement strings.

jferard commented 6 years ago

A benchmark with a new (clearer) version:

Benchmark Mode Cnt Score Error Units FastOdsXMLEscaperBenchmark.testEscape thrpt 5 206172,176 ± 1264,284 ops/s FastOdsXMLEscaperBenchmark.testEscapeNew thrpt 5 205169,181 ± 1403,141 ops/s FastOdsXMLEscaperBenchmark.testLongText thrpt 5 208600,043 ± 1190,734 ops/s FastOdsXMLEscaperBenchmark.testLongTextNew thrpt 5 209357,439 ± 1213,735 ops/s