Mercurial > hg > monetdb-java
diff src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java @ 322:0fcf338ce0b4
Optimized parse method of TupleLineParser by creating less helper objects and replacing method calls by direct operations on variables.
We now only create a StringBuilder object uesc when it is needed (when an escaped character is detected in the tuple line).
In most tuple data lines no escape characters are used and thus the StringBuilder object was not used/needed.
Also increased the default capacity of StringBuilder uesc such that it is not enlarged so often.
Also made StringBuilder object uesc now part of the TupleLineParser object, such that it can be reused by
many parse() calls, again reducing the number of created StringBuilder objects.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Wed, 11 Sep 2019 17:18:00 +0200 (2019-09-11) |
parents | bb273e9c7e09 |
children | 54137aeb1f92 |
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java +++ b/src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java @@ -26,7 +26,7 @@ package nl.cwi.monetdb.mcl.parser; public abstract class MCLParser { /** The String values found while parsing. Public, you may touch it. */ public final String values[]; - protected int colnr; + protected int colnr = 0; /** * Creates an MCLParser targetted at a given number of field values.