Commit graph

384 commits

Author SHA1 Message Date
Peter Taoussanis
c0d1da1bb4 [nop] Housekeeping 2024-10-28 10:14:25 +01:00
Peter Taoussanis
c5209e32ce [nop] Bump deps 2024-05-26 14:24:15 +02:00
Peter Taoussanis
f6240582e1 [#174] Improve extend-freeze docstring 2024-05-03 11:21:54 +02:00
Peter Taoussanis
dc52356106 [new] Improve data compatibility when updating Nippy versions
When support is added for a new type in Nippy version X, it necessarily means
that data containing that new type and frozen with Nippy version X is unthawable
with Nippy versions < X.

Earlier versions of Nippy will throw an exception on thawing affected data:
  \"Unrecognized type id (<n>). Data frozen with newer Nippy version?\"

This can present a challenge when updating to new versions of Nippy, e.g.:

  - Rolling updates could lead to old and new versions of Nippy temporarily co-existing.
  - Data written with new types could limit your ability to revert a Nippy update.

There's no easy solution to this in GENERAL, but we CAN at least help reduce the
burden related to CHANGES in core data types by introducing changes over 2 phases:

  1. Nippy vX   reads  new (changed) type, writes old type
  2. Nippy vX+1 writes new (changed) type

When relevant, we can then warn users in the CHANGELOG to not leapfrog
(e.g. Nippy vX -> Nippy vX+2) when doing rolling updates.

This commit bootstraps the new compatibility feature by initially targeting core type
compatibility with Nippy v3.2.0 (2022-07-18).

A future Nippy version (e.g. v3.5.0) will then target v3.4.0, with an appropriate
CHANGELOG instruction to update in phases for environments that involve rolling
updates.
2024-05-02 14:26:25 +02:00
Peter Taoussanis
229ab94c14 [nop] Housekeeping 2024-05-02 13:58:50 +02:00
Peter Taoussanis
51298e9252 [nop] Bump deps 2024-04-30 11:14:11 +02:00
Peter Taoussanis
82a050b925 [mod] Don't attach empty metadata 2024-04-10 11:29:09 +02:00
Peter Taoussanis
37cf415c02 [new] [#171] Auto strip metadata protocol extensions
Allows serialization of next.jdbc results, etc.
2024-04-10 11:29:09 +02:00
Peter Taoussanis
92c4a83d61 [fix] Broken *final-freeze-fallback* default val 2024-04-10 11:29:09 +02:00
Peter Taoussanis
af928ed6a4 [nop] Refactor deftype freezer 2024-04-10 11:29:09 +02:00
Peter Taoussanis
f749e07eed [nop] Switch nippy.tools to faster enc/binding 2024-04-10 11:29:09 +02:00
Peter Taoussanis
4d96757447 [nop] Bump deps 2024-04-10 11:29:09 +02:00
Peter Taoussanis
cb0b871fe8 [new] Re-enable Snappy compressor
Upstream safety issue has been resolved,
Ref. <https://github.com/airlift/aircompressor/issues/183>.
2024-02-26 11:07:42 +01:00
Peter Taoussanis
7be9b4f789 [nop] Bump deps 2024-02-26 11:07:42 +01:00
Peter Taoussanis
cb5b7cf063 [fix] [#169] Can't auto-identify :zstd compressor when decompressing 2024-02-26 11:07:42 +01:00
Peter Taoussanis
b4d161db53 v3.4.0-RC1 (2024-02-06) 2024-02-06 16:02:05 +01:00
Peter Taoussanis
578c585bbf [mod] Remove nippy/snappy-compressor
Details:

  - Nippy will continue to support thawing OLD data that was originally compressed with Snappy.
  - But Nippy will no longer support freezing NEW data with Snappy.

Motivation:

  - The current Snappy implementation can cause JVM crashes in some cases [1].

  - The only alternative JVM implementation that seems to be safe [2] uses JNI and
    so would introduce possible incompatibility issues even for folks not using Snappy.

  - Nippy already moved to the superior LZ4 as its default compression scheme in v2.7.0,
    more than 9 years ago.

[1] Ref. <https://github.com/airlift/aircompressor/issues/183>
[2] Ref. <https://github.com/xerial/snappy-java>
2024-02-06 16:01:13 +01:00
Peter Taoussanis
676898495c [wip] Explore Snappy implementations 2024-02-06 14:30:59 +01:00
Peter Taoussanis
7d2800d106 [nop] Updates for latest Encore 2024-02-06 14:30:59 +01:00
Peter Taoussanis
3c27f03bc4 [nop] Bump deps 2024-02-06 14:30:59 +01:00
Peter Taoussanis
f287df9e9c [nop] thaw-xform housekeeping 2024-02-06 14:30:59 +01:00
Peter Taoussanis
9b27a00a59 [nop] Protocol housekeeping 2024-02-06 14:30:59 +01:00
Peter Taoussanis
9db09e16a9 [new] [#163] Track serialized output in tests 2024-02-06 14:30:59 +01:00
Peter Taoussanis
c2770c6e99 [mod] Refactor stress data
BREAKING for the very small minority of folks that use `nippy/stress-data`.

Changes:

1. Make `nippy/stress-data` a function

   It's unnecessarily wasteful to generate and store all this data when it's not
   being used in the common case.

2. Make data deterministic

   The stress data will now generally be stable by default between different versions
   of Nippy, etc. This will help support an upcoming test for stable serialized output.
2024-02-06 14:30:59 +01:00
Peter Taoussanis
ba6477c097 [nop] Refactor type-checking, remove vestigial utils ns 2024-02-06 14:30:59 +01:00
Peter Taoussanis
27b3ed958b [nop] Misc housekeeping 2024-02-06 14:30:59 +01:00
Peter Taoussanis
d566134da8 [nop] Misc housekeeping 2023-10-11 14:23:34 +02:00
Peter Taoussanis
f3ff7ae8a3 [new] Add native MapEntry freezer 2023-10-11 14:23:34 +02:00
Peter Taoussanis
fb6f75e4d7 [new] Smarter, faster, protocol-based freezable? util 2023-10-11 14:23:34 +02:00
Peter Taoussanis
bcf767332e [nop] Move benchmarks ns under tests dir
Prevents benchmark code from being unnecessarily included as dependency
2023-10-11 14:23:34 +02:00
Peter Taoussanis
fef079d81d [new] Add subvec to stress data 2023-10-11 14:23:34 +02:00
Peter Taoussanis
6ad5aebd1a [new] Add :zstd compressor, new compressor backend
Also switch to https://github.com/airlift/aircompressor for faster
and combined implementations of: LZ4, Snappy
2023-10-11 14:23:34 +02:00
Peter Taoussanis
c8f30e171d [wip] aircompressor experiments (pure Java compression lib) 2023-10-11 14:23:34 +02:00
Peter Taoussanis
01e42d23e6 [new] [#160] Add more info to *freeze-fallback* docstring 2023-09-25 11:50:06 +02:00
Peter Taoussanis
e864294321 [nop] Changes for dependency bumps 2023-09-25 11:50:06 +02:00
Peter Taoussanis
d5a836326a [nop] Misc housekeeping 2023-09-25 11:33:32 +02:00
Peter Taoussanis
ed95701c79 [nop] Bring back private write-str-sm
Hadn't actually intended to remove this
2023-08-03 17:14:16 +02:00
Peter Taoussanis
ac24f872a8 [nop] Add missing metadata to new *thaw-xform* var 2023-08-02 14:44:07 +02:00
Peter Taoussanis
8b7186a930 [nop] Update benchmark results 2023-08-02 13:50:40 +02:00
Peter Taoussanis
89f98b440f [new] [#153] PoC: transducer support on thaw
Note: also considered (but ultimately rejected) idea of a separate
`*thaw-mapfn*` opt that operates directly on every `thaw-from-in!`
result.

This (transducer) approach is more flexible, and covers the most
common use cases just fine. Having both seems excessive.
2023-08-02 13:50:40 +02:00
Peter Taoussanis
60bc4e9976 [new] [Storage efficiency] PoC: unsigned counts for small core colls
This change affects small: strings, vectors, sets, and maps so that
they use *unsigned* element counts.

Before: counts in [0, 127] use 1 byte
After:  counts in [0, 255] use 1 byte

I.e. doubles the range of counts that can be stored in 1 byte.

This changes saves:
  - 1 byte per count in [128, 255]

Is this advantage worth the extra complexity? Probably no in isolation,
but this is a reasonable opportunity to lay the groundwork for unsigned
element counts for future types.
2023-08-02 13:50:40 +02:00
Peter Taoussanis
0a9d67084b [new] [Storage efficiency] PoC: separate signed long types
Before:
  Longs in [  -128,   127] use 1 byte
  Longs in [-32768, 32767] use 2 bytes
  etc.

After:
  Longs in [  -255,   255] use 1 byte
  Longs in [-65535, 65535] use 2 bytes
  etc.

I.e. doubles the range of longs that can be stored by 1, 2, and 4 bytes.

This changes saves:
  - 1 byte  per long in [  128,   255], or [  -129,   -255]
  - 2 bytes per long in [32768, 65535], or [-32769, -65535]
  - 4 bytes per long ...

Is this advantage worth the extra complexity? Probably yes, given how
common longs (and colls of longs) are in Clojure.
2023-08-02 13:50:40 +02:00
Peter Taoussanis
fa1cc66bf3 [fix] [#143] Don't freeze meta info for types that don't support with-meta 2023-08-02 13:50:40 +02:00
Peter Taoussanis
aba153e086 [new] [#159] Add native impln for java.sql.Date (@philomates) 2023-08-02 13:43:59 +02:00
Peter Taoussanis
d8b1825ea0 [new] [#158] Add java.lang.ClassCastException to default thaw allow list (@carlosgeos) 2023-08-02 13:43:59 +02:00
Peter Taoussanis
8778fa49cc [new] Include :bindings in ex-data of thaw failures 2023-08-02 13:43:59 +02:00
Peter Taoussanis
8e363dbcf9 [#154] Revert "[mod] [DEPRECATED] Remove ability to freeze new data using experimental cache feature"
This reverts commit f1af0cae674f7dea29d460c5b630a58c59c7dcab.

Motivation for revert:

  At least 1 user has reported depending on the current `cache`
  feature, and implementing it manually (i.e. outside of Nippy) can
  be non-trivial.

  Rather than risk breaking folks, I'll take some more time to
  consider alternatives. There's no urgency on this.
2023-08-02 13:43:59 +02:00
Peter Taoussanis
648d5c0232 [mod] [DEPRECATED] Remove ability to freeze new data using experimental cache feature
This commit is BREAKING for those still actively using `nippy/cache`.

Data previously frozen using `nippy/cache` can still be thawed, though
support for thawing may also be removed in a future Nippy version.

Motivation for removal:

  This cache feature (marked as experimental) was always a bit dubious.
  The use cases were very limited, and the complexity quite significant.

  I don't believe that the feature has ever had much (any?) public
  adoption, so I'm removing it here.

  PLEASE LET ME KNOW if this removal negatively impacts you.
2023-08-02 13:43:59 +02:00
Peter Taoussanis
0a15278206 [nop] Use UTF8 charset const 2023-08-02 13:43:59 +02:00
Peter Taoussanis
621f1189c7 [nop] Misc housekeeping 2023-08-02 13:43:47 +02:00