Home

Awesome

Maven Central

FastDoubleParser

This is a Java port of Daniel Lemire's fast_float project.

This project provides parsers for double, float, BigDecimal and BigInteger values. The double and float parsers are optimised for speed for the most common inputs. The BigDecimal and BigInteger parsers are optimised for speed on all inputs.

The code in this project contains optimised versions for Java SE 1.8, 11, 17, 21 and 22. The code is released in a single multi-release jar, which contains the code for all these versions except 20.

License

Project License

This project can be licensed under the MIT License.

Code License

Some code in this project is derived from the following projects:

The code is marked as such.

If you redistribute code, you must follow the terms of all involved licenses (MIT License, BSD 2-clause License).

The build scripts in this project do include the license files into the jar files. So that the released jar files automatically comply with the licenses, when you use them.

Dependency

You can download released Jar files from github, or from a public Maven using the following dependency descriptor:


<dependency>
  <groupId>ch.randelshofer</groupId>
  <artifactId>fastdoubleparser</artifactId>
  <version>…version…</version>
</dependency>

Usage

module MyModule {
    requires ch.randelshofer.fastdoubleparser;
}
import ch.randelshofer.fastdoubleparser.JavaDoubleParser;
import ch.randelshofer.fastdoubleparser.JavaFloatParser;
import ch.randelshofer.fastdoubleparser.JavaBigDecimalParser;
import ch.randelshofer.fastdoubleparser.JavaBigIntegerParser;
import ch.randelshofer.fastdoubleparser.JsonDoubleParser;
import ch.randelshofer.fastdoubleparser.NumberFormatSymbols;
import ch.randelshofer.fastdoubleparser.ConfigurableDoubleParser;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormatSymbols;

import java.util.List;
import java.util.Locale;
import java.util.Set;

class MyMain {
    public static void main(String... args) {
        double d = JavaDoubleParser.parseDouble("1.2345e135");
        System.out.println("Java double value: " + d);

        float f = JavaFloatParser.parseFloat("1.2345f");
        System.out.println("Java float value: " + f);

        BigDecimal bd = JavaBigDecimalParser.parseBigDecimal("1.2345");
        System.out.println("Java big decimal value: " + bd);

        BigInteger bi = JavaBigIntegerParser.parseBigInteger("12345");
        System.out.println("Java big integer value: " + bi);

        double jsonD = JsonDoubleParser.parseDouble("1.2345e85");
        System.out.println("JSON double value: " + jsonD);

        var symbols = NumberFormatSymbols.fromDecimalFormatSymbols(new DecimalFormatSymbols(Locale.GERMAN));
        boolean ignoreCase = true;
        var confdParser = new ConfigurableDoubleParser(symbols, ignoreCase);
        double confD1 = confdParser.parseDouble("123.456,89e5");
        double confD2 = confdParser.parseDouble("-0.15425,89E-5");
        System.out.println("Double value in German Locale: " + confD1);
        System.out.println("Another double value in German Locale: " + confD2);

        symbols = NumberFormatSymbols.fromDecimalFormatSymbols(new DecimalFormatSymbols(Locale.forLanguageTag("zh-CN")));
        symbols = symbols
                .withDigits(List.of('〇', '一', '二', '三', '四', '五', '六', '七', '八', '九'))
                .withExponentSeparator((Set.of("*一〇^")));

        confdParser = new ConfigurableDoubleParser(symbols, ignoreCase);
        double confZh = confdParser.parseDouble("四一.五七五三七一六六二一四五九八*一〇^七");
        System.out.println("Double value in Chinese Locale: " + confZh);
    }
}

The parse...()-methods take a CharacterSequence. a char-array or a byte-array as argument. This way, you can parse from a StringBuffer or an array without having to convert your input to a String. Parsing from an array is faster, because the parser can process multiple characters at once using SIMD instructions.

Performance Tuning

The JVM does not reliably inline String.charAt(int). This may negatively impact the parse...()-methods that take a CharacterSequence as an argument.

To ensure optimal performance, you can use the following java command line option:

-XX:CompileCommand=inline,java/lang/String.charAt

Performance Characteristics

float and double parsers

On common input data, the fast double and float parsers are about 4 times faster than java.lang.Double.valueOf(String) and java.lang.Float.valueOf(String).

For less common inputs, the fast parsers can be slower than their java.lang counterparts.

A double value can always be specified exactly with up to 17 digits in the significand. A float only needs up to 8 digits. Therefore, inputs with more than 19 digits in the significand are considered less common. Such inputs are expected to occur if the input data was created with more precision, and needs to be narrowed down to the precision of a double or a float.

BigDecimal and BigInteger parsers

On common input data, the fast BigDecimal and BigInteger parsers are slightly faster than java.math.BigDecimal(String) and java.math.BigInteger(String).

For less common inputs with many digits, the fast parsers can be a lot faster than their java.math counterparts. The fast parsers can convert even the longest supported inputs in less than 6 minutes, whereas their java.math counterparts need months!

The fast parsers convert digit characters from base 10 to a bit sequence in base 2 using a divide-and-conquer algorithm. Small sequences of digits are converted individually to bit sequences and then gradually combined to the final bit sequence. This algorithm needs to perform multiplications of very long bit sequences. The multiplications are performed in the frequency domain using a discrete fourier transform. The multiplications in the frequency domain can be performed in O(N log N (log log N)) time, where N is the number of digits. In contrast, conventional multiplication algorithms in the time domain need O(N²) time.

Memory usage and computation time

The memory usage depends on the result type and the maximal supported input character length.

The computation times are given for a Mac mini 2018 with Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz.

ParserResult TypeMaximal<br/>input lengthMemory usage<br/>JVM -XmxComputation<br/>Time
JavaDoubleParserjava.lang.Double2^31 - 510 gigabytes< 5 sec
JavaFloatParserjava.lang.Float2^31 - 510 gigabytes< 5 sec
JavaBigIntegerParserjava.math.BigInteger1,292,782,62216 gigabytes< 6 min
JavaBigDecimalParserjava.math.BigDecimal1,292,782,63516 gigabytes< 6 min

Performance measurements

The data file canada.txt

This file contains numbers in the range from -128 to +128. Most input lines look like this: 52.038048000000117.

CPU: Apple M2 Max<br> OS: Mac OS X, 14.7, 12 processors available<br> VM: Java 23, OpenJDK 64-Bit Server VM, Azul Systems, Inc., 23.0.1+11<br> -XX:CompileCommand=inline,java/lang/String.charAt

MethodMB/sstdevMfloats/sns/fspeedupJDK
java.lang.Double107.962.0 %6.20161.191.00=a23.0.1
java.lang.Float118.123.1 %6.79147.321.00=b23.0.1
java.math.BigDecimal400.254.8 %23.0043.481.00=c23.0.1
java.text.NumberFormat72.061.6 %4.14241.491.00=d23.0.1
com.ibm.icu.text.NumberFormat24.322.7 %1.40715.621.00=e23.0.1
JavaDoubleParser CharSequence532.054.3 %30.5832.714.93*a23.0.1
JavaDoubleParser char[]973.387.1 %55.9417.889.02*a23.0.1
JavaDoubleParser byte[]962.188.0 %55.2918.098.91*a23.0.1
JsonDoubleParser CharSequence575.455.8 %33.0730.245.33*a23.0.1
JsonDoubleParser char[]991.206.2 %56.9617.569.18*a23.0.1
JsonDoubleParser byte[]990.745.5 %56.9317.569.18*a23.0.1
JavaFloatParser CharSequence572.026.0 %32.8730.424.84*b23.0.1
JavaFloatParser char[]1007.9621.5 %57.9217.268.53*b23.0.1
JavaFloatParser byte[]1011.756.3 %58.1417.208.57*b23.0.1
JavaBigDecimalParser CharSequence773.445.9 %44.4522.501.93*c23.0.1
JavaBigDecimalParser char[]1140.286.3 %65.5315.262.85*c23.0.1
JavaBigDecimalParser byte[]1097.8215.1 %63.0915.852.74*c23.0.1
ConfigurableDoubleParser CharSequence483.995.6 %27.8135.956.72*d23.0.1
ConfigurableDoubleParser char[]689.587.1 %39.6325.239.57*d23.0.1
ConfigurableDoubleParser byte[]625.564.4 %35.9527.828.68*d23.0.1
ConfigurableDoubleParserCI CharSequence493.745.4 %28.3735.246.85*d23.0.1
ConfigurableDoubleParserCI char[]701.504.6 %40.3124.819.73*d23.0.1
ConfigurableDoubleParserCI byte[]531.046.5 %30.5232.777.37*d23.0.1

Mac Mini (2018)<br> CPU: Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz<br> OS: Mac OS X, 15.0.1, 12 processors available<br> VM: Java 24, OpenJDK 64-Bit Server VM, Oracle Corporation, 24-ea+20-2362<br>

MethodMB/sstdevMfloats/sns/fspeedupJDK
java.lang.Double88.843.8 %5.11195.871.00=a24-ea
java.lang.Float101.303.7 %5.82171.781.00=b24-ea
java.math.BigDecimal321.368.6 %18.4754.151.00=c24-ea
java.text.NumberFormat45.793.0 %2.63379.991.00=d24-ea
com.ibm.icu.text.NumberFormat15.983.0 %0.921088.621.00=e24-ea
JavaDoubleParser CharSequence393.169.2 %22.5944.264.43*a24-ea
JavaDoubleParser char[]595.2512.8 %34.2129.236.70*a24-ea
JavaDoubleParser byte[]685.3810.1 %39.3925.397.71*a24-ea
JsonDoubleParser CharSequence391.589.8 %22.5044.444.41*a24-ea
JsonDoubleParser char[]609.5910.4 %35.0328.556.86*a24-ea
JsonDoubleParser byte[]675.529.2 %38.8225.767.60*a24-ea
JavaFloatParser CharSequence402.359.1 %23.1243.253.97*b24-ea
JavaFloatParser char[]712.3510.5 %40.9424.437.03*b24-ea
JavaFloatParser byte[]626.709.4 %36.0127.776.19*b24-ea
JavaBigDecimalParser CharSequence428.9217.7 %24.6540.571.33*c24-ea
JavaBigDecimalParser char[]660.1812.2 %37.9426.362.05*c24-ea
JavaBigDecimalParser byte[]669.9711.5 %38.5025.972.08*c24-ea
ConfigurableDoubleParser CharSequence335.029.2 %19.2551.947.32*d24-ea
ConfigurableDoubleParser char[]527.1412.1 %30.2933.0111.51*d24-ea
ConfigurableDoubleParser byte[]474.357.6 %27.2636.6910.36*d24-ea
ConfigurableDoubleParserCI CharSequence330.359.9 %18.9852.677.21*d24-ea
ConfigurableDoubleParserCI char[]519.329.8 %29.8433.5111.34*d24-ea
ConfigurableDoubleParserCI byte[]406.107.4 %23.3442.858.87*d24-ea

Comparison with C version

For comparison. here are the test results of simple_fastfloat_benchmark
on the same computer:

version: Thu Mar 31 10:18:12 2022 -0400 f2082bf747eabc0873f2fdceb05f9451931b96dc

Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz SIMD-256

$ ./build/benchmarks/benchmark
# parsing random numbers
available models (-m): uniform one_over_rand32 simple_uniform32 simple_int32 int_e_int simple_int64 bigint_int_dot_int big_ints 
model: generate random numbers uniformly in the interval [0.0.1.0]
volume: 100000 floats
volume = 2.09808 MB 
netlib                       :   317.31 MB/s (+/- 6.0 %)    15.12 Mfloat/s      66.12 ns/f 
doubleconversion             :   263.89 MB/s (+/- 4.2 %)    12.58 Mfloat/s      79.51 ns/f 
strtod                       :    86.13 MB/s (+/- 3.7 %)     4.10 Mfloat/s     243.61 ns/f 
abseil                       :   467.27 MB/s (+/- 9.0 %)    22.27 Mfloat/s      44.90 ns/f 
fastfloat                    :   880.79 MB/s (+/- 6.6 %)    41.98 Mfloat/s      23.82 ns/f 

Java 22, OpenJDK 64-Bit Server VM, Oracle Corporation, 22.0.1+8-16
java.lang.Double             :    94.32 MB/s (+/- 3.1 %)     5.41 Mfloat/s     184.73 ns/f     1.00 speedup
JavaDoubleParser CharSequence:   585.84 MB/s (+/-12.4 %)    33.62 Mfloat/s      29.74 ns/f     6.21 speedup
JavaDoubleParser char[]      :   659.27 MB/s (+/- 9.6 %)    37.84 Mfloat/s      26.43 ns/f     6.99 speedup
JavaDoubleParser byte[]      :   729.46 MB/s (+/- 9.7 %)    41.86 Mfloat/s      23.89 ns/f     7.73 speedup

'

$ ./build/benchmarks/benchmark -f data/canada.txt
# read 111126 lines 
volume = 1.93374 MB 
netlib                       :   337.79 MB/s (+/- 5.8 %)    19.41 Mfloat/s      51.52 ns/f 
doubleconversion             :   254.22 MB/s (+/- 6.0 %)    14.61 Mfloat/s      68.45 ns/f 
strtod                       :    73.33 MB/s (+/- 7.1 %)     4.21 Mfloat/s     237.31 ns/f 
abseil                       :   411.11 MB/s (+/- 7.3 %)    23.63 Mfloat/s      42.33 ns/f 
fastfloat                    :   741.32 MB/s (+/- 5.3 %)    42.60 Mfloat/s      23.47 ns/f 

 Java 22, OpenJDK 64-Bit Server VM, Oracle Corporation, 22.0.1+8-16
java.lang.Double             :    87.48 MB/s (+/- 3.2 %)     5.03 Mfloat/s     198.93 ns/f     1.00 speedup
JavaDoubleParser CharSequence:   386.93 MB/s (+/- 8.8 %)    22.24 Mfloat/s      44.97 ns/f     4.42 speedup
JavaDoubleParser char[]      :   637.55 MB/s (+/- 9.0 %)    36.64 Mfloat/s      27.29 ns/f     7.29 speedup
JavaDoubleParser byte[]      :   694.16 MB/s (+/- 7.9 %)    39.89 Mfloat/s      25.07 ns/f     7.94 speedup

Building and running the code

This project requires at least the items below to build it from source:

This project contains optimised code for various JDK versions. If you intend to assess the fitness and/or performance of this project for all supported JDKs, you also need to install the following items:

When you clone the code repository from github. you can choose from the following branches:

Command sequence with Java SE 23 on macOS:

git clone https://github.com/wrandelshofer/FastDoubleParser.git
cd FastDoubleParser 
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-23.jdk/Contents/Home 
javac --enable-preview -source 23 -d out -encoding utf8 --module-source-path fastdoubleparser-dev/src/main/java --module ch.randelshofer.fastdoubleparser    
javac --enable-preview -source 23 -d out -encoding utf8 -p out --module-source-path fastdoubleparserdemo-dev/src/main/java --module ch.randelshofer.fastdoubleparserdemo
java -XX:CompileCommand=inline,java/lang/String.charAt --enable-preview -p out -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown
java -XX:CompileCommand=inline,java/lang/String.charAt --enable-preview -p out -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada.txt   
java -XX:CompileCommand=inline,java/lang/String.charAt --enable-preview -p out -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/mesh.txt   
java -XX:CompileCommand=inline,java/lang/String.charAt --enable-preview -p out -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada_hex.txt   

Command sequence with Azul Zulu Java SE 8, 11, 17, 21, and 23, and Maven 3.9.8 on macOS:

git clone https://github.com/wrandelshofer/FastDoubleParser.git
cd FastDoubleParser
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-23.jdk/Contents/Home 
mvn clean
mvn package
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-23.jdk/Contents/Home 
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/mesh.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada_hex.txt
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home 
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/mesh.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada_hex.txt
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home 
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/mesh.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada_hex.txt
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/mesh.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -p fastdoubleparser/target:fastdoubleparserdemo/target -m ch.randelshofer.fastdoubleparserdemo/ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada_hex.txt
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-8.jdk/Contents/Home
java -XX:CompileCommand=inline,java/lang/String.charAt -cp "fastdoubleparser/target/*:fastdoubleparserdemo/target/*" ch.randelshofer.fastdoubleparserdemo.Main --markdown
java -XX:CompileCommand=inline,java/lang/String.charAt -cp "fastdoubleparser/target/*:fastdoubleparserdemo/target/*" ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -cp "fastdoubleparser/target/*:fastdoubleparserdemo/target/*" ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/mesh.txt
java -XX:CompileCommand=inline,java/lang/String.charAt -cp "fastdoubleparser/target/*:fastdoubleparserdemo/target/*" ch.randelshofer.fastdoubleparserdemo.Main --markdown FastDoubleParserDemo/data/canada_hex.txt

IntelliJ IDEA with Java SE 8, 11, 17, 21, 23 on macOS

Prerequisites:

  1. Install the following Java SDKs: 8, 11, 17, 21, 23. If you do not need to edit the code, you only need to install the Java 23 SDK.
  2. Install IntelliJ IDEA

Steps:

  1. Start IntelliJ IDEA

  2. From the main menu, choose Git > Clone...

  3. In the dialog that opens, enter the URL https://github.com/wrandelshofer/FastDoubleParser.git, specify the directory in which you want to save the project and click Clone.

  4. Intellij IDEA will now clone the repository and open a new project window. However, the project modules are not yet configured correctly.

  5. From the main menu of the new project window, choose View > Tool Windows > Maven

  6. In the Maven tool window, run the Maven build Parent project for FastDoubleParser > Lifecycle > compile

  7. In the toolbar of the Maven tool window, click Reload All Maven Projects

  8. Intellij IDEA knows now for each module, where the source, generated source, test source, and generated test source folders are. However, the project modules have still incorrect JDK dependencies.

  9. You can skip this step, if you do not want to edit the code. From the main menu, choose File > Project Structure...

  10. You can skip this step, if you do not want to edit the code. In the dialog that opens, select in the navigation bar Project Settings > Modules

  11. You can skip this step, if you do not want to edit the code. For each module in the right pane of the dialog, select the Dependencies tab. Specify the corresponding Module SDK for modules which have a name that ends in -Java8, -Java11, -Java17, -Java21. Do not change modules with other name endings - they must stay on the Java 20 SDK.

  12. From the main menu, choose Build > Build Project Intellij IDEA will now properly build the project.

Editing the code

The majority of the code is located in the module named fastdoubleparser-dev, and fastdoubleparserdemo-dev. The code in these modules uses early access features of the Java 20 SDK.

Modules which have a name that ends in -Java8, -Java11, -Java17, -Java21, -Java23 contain deltas of the -dev modules.

The delta code is located in the source and test folders of the module. Code from the -dev module is located in the generated source and generated test source folders.

The Maven POM of a module contains maven-resources-plugin elements that copy code from the -dev module to the delta modules.

Testing the code

Unfortunately it is not possible to test floating parsers exhaustively, because the input and output spaces are far too big.

ParserInput SpaceOutput Space
JavaDoubleParser1 to 2<sup>31</sup>-1 chars<br>= 65536<sup>2<sup>31</sup></sup><br>= 2<sup>34,359,738,368</sup>64 bits<br>= 2<sup>64</sup>
JavaFloatParser1 to 2<sup>31</sup>-1 chars<br>= 2<sup>34,359,738,368</sup>32 bits<br>= 2<sup>32</sup>
JsonDoubleParser1 to 2<sup>31</sup>-1 chars<br>= 2<sup>34,359,738,368</sup>64 bits<br>= 2<sup>64</sup>
JavaBigIntegerParser1 to 1,292,782,622 chars<br>= 65536<sup>1292782623</sup><br>= 2<sup>20,684,521,968</sup>0 to 2<sup>31</sup> bits<br>= 2<sup>2<sup>31</sup></sup><br>= 2<sup>2,147,483,648</sup>
JavaBigDecimalParser1 to 1,292,782,635 chars<br>= 65536<sup>1292782636</sup><br>= 2<sup>20,684,522,176</sup>0 to 2<sup>31</sup> bit mantissa * 64 bit exponent<br>= 2<sup>12,884,901,888</sup>

You can quickly run a number of hand-picked tests that aim for 100 % line coverage:

mvn -DenableLongRunningTests=true test

You can run additional tests with the following command. The purpose of these tests is to explore additional regions of the input and output spaces.

mvn -DenableLongRunningTests=true test