Skip to content

Commit

Permalink
Fixes #1231: enable fast FP reads/writes by default
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 2, 2024
1 parent f640986 commit 465738e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ JSON library.
#1090: Remove `BufferRecyclers.SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS`
#1125: Remove `TokenStreamFactory.Feature.USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING`
#1200: Change `JsonWriteFeature.ESCAPE_FORWARD_SLASHES` default to `true` for 3.0
#1231: Enable Fast Floating-Point reading/writing by default in 3.0
- Rename `JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT` as `AUTO_CLOSE_CONTENT`
- Add `TreeCodec.nullNode()`, `TreeNode.isNull()` methods
- Change the way `JsonLocation.NA` is included in exception messages
22 changes: 12 additions & 10 deletions src/main/java/tools/jackson/core/StreamReadFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,24 @@ public enum StreamReadFeature
INCLUDE_SOURCE_IN_LOCATION(false),

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

/**
* Feature that determines whether to use the built-in Java code for parsing
* <code>BigDecimal</code>s and <code>BigIntegers</code>s or to use
* {@code FastDoubleParser} instead.
* Feature that determines whether to use the built-in JDK code for parsing
* <code>BigDecimal</code> and <code>BigIntegers</code> values (if {@code disabled})
* or {@code FastDoubleParser} implementation (if {@code enabled}).
*<p>
* This setting is disabled by default.
* This setting is enabled by default (since 3.0) so that {@code FastDoubleParser}
* implementation is used.
*/
USE_FAST_BIG_NUMBER_PARSER(false)
USE_FAST_BIG_NUMBER_PARSER(true)

;

Expand Down
9 changes: 4 additions & 5 deletions src/main/java/tools/jackson/core/StreamWriteFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,13 @@ public enum StreamWriteFeature
// // Misc other features

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

0 comments on commit 465738e

Please sign in to comment.