Skip to content

Commit 465738e

Browse files
committed
Fixes #1231: enable fast FP reads/writes by default
1 parent f640986 commit 465738e

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

release-notes/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ JSON library.
4141
#1090: Remove `BufferRecyclers.SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS`
4242
#1125: Remove `TokenStreamFactory.Feature.USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING`
4343
#1200: Change `JsonWriteFeature.ESCAPE_FORWARD_SLASHES` default to `true` for 3.0
44+
#1231: Enable Fast Floating-Point reading/writing by default in 3.0
4445
- Rename `JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT` as `AUTO_CLOSE_CONTENT`
4546
- Add `TreeCodec.nullNode()`, `TreeNode.isNull()` methods
4647
- Change the way `JsonLocation.NA` is included in exception messages

src/main/java/tools/jackson/core/StreamReadFeature.java

+12-10
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,24 @@ public enum StreamReadFeature
9494
INCLUDE_SOURCE_IN_LOCATION(false),
9595

9696
/**
97-
* Feature that determines whether we use the built-in {@link Double#parseDouble(String)} code to parse
98-
* doubles or if we use {@code FastDoubleParser}
99-
* instead.
97+
* Feature that determines whether to use the built-in JDK {@link Double#parseDouble(String)}
98+
* code to parse {@code double}s (if {@code disabled})
99+
* or {@code FastDoubleParser} implementation (if {@code enabled}).
100100
*<p>
101-
* This setting is disabled by default.
101+
* This setting is enabled by default (since 3.0) so that {@code FastDoubleParser}
102+
* implementation is used.
102103
*/
103-
USE_FAST_DOUBLE_PARSER(false),
104+
USE_FAST_DOUBLE_PARSER(true),
104105

105106
/**
106-
* Feature that determines whether to use the built-in Java code for parsing
107-
* <code>BigDecimal</code>s and <code>BigIntegers</code>s or to use
108-
* {@code FastDoubleParser} instead.
107+
* Feature that determines whether to use the built-in JDK code for parsing
108+
* <code>BigDecimal</code> and <code>BigIntegers</code> values (if {@code disabled})
109+
* or {@code FastDoubleParser} implementation (if {@code enabled}).
109110
*<p>
110-
* This setting is disabled by default.
111+
* This setting is enabled by default (since 3.0) so that {@code FastDoubleParser}
112+
* implementation is used.
111113
*/
112-
USE_FAST_BIG_NUMBER_PARSER(false)
114+
USE_FAST_BIG_NUMBER_PARSER(true)
113115

114116
;
115117

src/main/java/tools/jackson/core/StreamWriteFeature.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,13 @@ public enum StreamWriteFeature
113113
// // Misc other features
114114

115115
/**
116-
* Feature that determines whether to use standard Java code to write floats/doubles
117-
* (default) or use the Schubfach algorithm which is faster.
116+
* Feature that determines whether to use standard JDK methods to write floats/doubles
117+
* or use faster Schubfach algorithm.
118118
* The latter approach may lead to small differences in the precision of the
119119
* float/double that is written to the JSON output.
120120
*<p>
121-
* Feature is disabled by default, meaning that slower JDK default conversions are used.
122-
*
123-
* @since 2.14
121+
* This setting is enabled by default (since 3.0) so that faster Schubfach
122+
* implementation is used.
124123
*/
125124
USE_FAST_DOUBLE_WRITER(false)
126125
;

0 commit comments

Comments
 (0)