hw-json-standard-cursor 0.2.1.0 → 0.2.1.1
raw patch · 3 files changed
+19/−3 lines, 3 filesdep ~optparse-applicativePVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: optparse-applicative
API changes (from Hackage documentation)
+ HaskellWorks.Data.Json.Standard.Cursor.Fast: fromByteStringViaBlanking :: ByteString -> Cursor
+ HaskellWorks.Data.Json.Standard.Cursor.Fast: fromByteStringViaSimd :: ByteString -> Cursor
Files
- hw-json-standard-cursor.cabal +1/−1
- src/HaskellWorks/Data/Json/Standard/Cursor/Fast.hs +17/−1
- src/HaskellWorks/Data/Json/Standard/Cursor/Load/Cursor.hs +1/−1
hw-json-standard-cursor.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: hw-json-standard-cursor-version: 0.2.1.0+version: 0.2.1.1 synopsis: Memory efficient JSON parser description: Memory efficient JSON parser. Please see README.md category: Data
src/HaskellWorks/Data/Json/Standard/Cursor/Fast.hs view
@@ -3,6 +3,8 @@ module HaskellWorks.Data.Json.Standard.Cursor.Fast ( Cursor , fromByteString+ , fromByteStringViaBlanking+ , fromByteStringViaSimd , fromForeignRegion , fromString , fromBsIbBp@@ -38,8 +40,22 @@ } where J.IbBp ibPart bpPart = ibBp +-- | Load a 'Cursor' from a 'ByteString' fromByteString :: BS.ByteString -> Cursor-fromByteString bs = fromBsIbBp bs (J.slowToIbBp bs)+fromByteString = fromByteStringViaBlanking+{-# DEPRECATED fromByteString "Use one of the other fromByteString* functions" #-}++-- | Load a 'Cursor' from a 'ByteString' via the blanking process.+-- This has reasonable performance, but uses a lot of memory due to+-- the lack of streaming+fromByteStringViaBlanking :: BS.ByteString -> Cursor+fromByteStringViaBlanking bs = fromBsIbBp bs (J.slowToIbBp bs)++-- | Load a 'Cursor' from a 'ByteString' via the blanking via `simd`+-- This has fast performance and streaming, but is only available+-- recent x86 platforms+fromByteStringViaSimd :: BS.ByteString -> Cursor+fromByteStringViaSimd jsonBs = fromBsIbBp jsonBs (simdToIbBp jsonBs) fromForeignRegion :: F.ForeignRegion -> Cursor fromForeignRegion (fptr, offset, size) = fromByteString (BSI.fromForeignPtr (castForeignPtr fptr) offset size)
src/HaskellWorks/Data/Json/Standard/Cursor/Load/Cursor.hs view
@@ -21,7 +21,7 @@ loadCursor :: String -> IO FAST.Cursor loadCursor path = do bs <- BS.mmap path- let !cursor = FAST.fromByteString bs+ let !cursor = FAST.fromByteStringViaBlanking bs return cursor loadCursorWithIndex :: String -> IO (GenericCursor BSI.ByteString (DVS.Vector Word64) (SimpleBalancedParens (DVS.Vector Word64)))