[nop] Improve fast-freeze docstring
This commit is contained in:
parent
5a9a391331
commit
7581ad23eb
1 changed files with 11 additions and 8 deletions
|
|
@ -1250,10 +1250,15 @@
|
||||||
- Drops all support for compression and encryption
|
- Drops all support for compression and encryption
|
||||||
- Must be thawed with `fast-thaw`
|
- Must be thawed with `fast-thaw`
|
||||||
|
|
||||||
Equivalent to (but a little faster than) `freeze` with opts:
|
Equivalent to (but a little faster than) `freeze` with opts
|
||||||
- :compressor nil
|
{:no-header? true, :compressor nil, :encryptor nil}.
|
||||||
- :encryptor nil
|
|
||||||
- :no-header? true"
|
Intended for use only by advanced users that clearly understand the tradeoffs.
|
||||||
|
I STRONGLY recommend that most users prefer the standard `freeze` since:
|
||||||
|
- The Nippy header is useful for data portability and preservation
|
||||||
|
- Compression is often benefitial at little/no cost
|
||||||
|
- The performance difference between `freeze` and `fast-freeze` is
|
||||||
|
often negligible in practice."
|
||||||
[x]
|
[x]
|
||||||
(let [baos (ByteArrayOutputStream. 64)
|
(let [baos (ByteArrayOutputStream. 64)
|
||||||
dos (DataOutputStream. baos)]
|
dos (DataOutputStream. baos)]
|
||||||
|
|
@ -1769,13 +1774,11 @@
|
||||||
|
|
||||||
(defn fast-thaw
|
(defn fast-thaw
|
||||||
"Like `thaw` but:
|
"Like `thaw` but:
|
||||||
- Drops all support for compression and encryption
|
|
||||||
- Supports only data frozen with `fast-freeze`
|
- Supports only data frozen with `fast-freeze`
|
||||||
|
- Drops all support for compression and encryption
|
||||||
|
|
||||||
Equivalent to (but a little faster than) `thaw` with opts:
|
Equivalent to (but a little faster than) `thaw` with opts:
|
||||||
- :compressor nil
|
{:no-header? true, :compressor nil, :encryptor nil}."
|
||||||
- :encryptor nil
|
|
||||||
- :no-header? true"
|
|
||||||
[^bytes ba]
|
[^bytes ba]
|
||||||
(let [dis (DataInputStream. (ByteArrayInputStream. ba))]
|
(let [dis (DataInputStream. (ByteArrayInputStream. ba))]
|
||||||
(with-cache (thaw-from-in! dis))))
|
(with-cache (thaw-from-in! dis))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue