Commit graph

632 commits

Author SHA1 Message Date
Peter Taoussanis
1dffa74b8e [nop] Update project template 2023-08-02 13:50:40 +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
Peter Taoussanis
129ce952bc [new] [#151] [#140] Add experimental public-types-spec 2023-08-02 13:29:27 +02:00
Peter Taoussanis
3ac06b6c87 [new] Refactor tools ns, embed dynamic *freeze-opts* in wrappers 2023-08-02 13:28:20 +02:00
Peter Taoussanis
064015e874 [nop] Update tests 2023-07-31 16:42:10 +02:00
Peter Taoussanis
d16293653c [new] Add cljdoc.edn config 2023-07-31 16:18:29 +02:00
Peter Taoussanis
1a803dde78 v3.2.0 2022-07-18 2022-07-18 09:21:55 +02:00
Peter Taoussanis
b10a0bf653 [nop] Clean up stress-data 2022-07-01 10:10:54 +02:00
Peter Taoussanis
3e928a9d33 v3.2.0-RC3 2022-06-27 2022-06-27 10:50:00 +02:00
Peter Taoussanis
a362398ccd [#145] [Fix] Freezing custom types with munged field names 2022-06-27 10:38:16 +02:00
Peter Taoussanis
941ad15b0f Refactor deftype tests 2022-06-27 10:00:02 +02:00
Peter Taoussanis
049197072c stress-data housekeeping 2022-06-27 09:59:59 +02:00
Peter Taoussanis
d2b994aafc v3.2.0-RC2 2022-06-23 2022-06-23 13:51:54 +02:00
Peter Taoussanis
761fcac4df [Change] Improve tools ns docstrings 2022-06-23 13:15:58 +02:00
Peter Taoussanis
9e69a284e1 [#148] [Fix] tools/freeze should use *freeze-opts* even for unwrapped vals 2022-06-23 13:07:02 +02:00
Peter Taoussanis
c6948ea40d v3.2.0-RC1 2022-06-23 2022-06-23 12:49:42 +02:00
Erik Assum
a2bb1d3de4 [#144] [New] Add org.joda.time.DateTime to default-thaw-serializable-allowlist (@slipset) 2022-06-23 12:35:47 +02:00
Karol Wójcik
434ed89af9 [#146] [New] Add Graal native configurations (@FieryCod) 2022-06-23 12:35:47 +02:00
Peter Taoussanis
65a138e27c Update Encore memoize (memoize_ was deprecated) 2022-06-23 12:35:47 +02:00
Peter Taoussanis
c9d2aae85d Bump minimum Encore version -> latest
Not strictly necessary, but probably not a bad idea to encourage folks
to at least get on v3.x since it does contain relevant performance
improvements.

Shouldn't be any reason preventing folks from using the latest version
of Encore unless they're on a really ancient version of Clojure
(< v1.7 released 2015).
2022-06-23 12:34:48 +02:00
Peter Taoussanis
f10722ac3f Bump deps 2022-06-23 12:29:04 +02:00
Peter Taoussanis
62d4deca54 v3.1.2 2022-06-23 2022-06-23 12:28:22 +02:00
Peter Taoussanis
8909a32bdd [#89 #150] [Fix] Boxed Booleans incorrectly freezing to primitive true (@RolT)
Before this commit:
  (freeze true)                  => froze as primitive `true`
  (freeze false)                 => froze as primitive `false`
  (freeze (Boolean. <anything>)) => froze as primitive `true`

After this commit:
  Boxed Booleans are first unboxed to correct primitive value before freezing

This was a long-standing bug, though thankfully unlikely to have affected most
users since boxed Booleans are rarely used in Clojure. Cases with Java interop
are the most likely to have been affected.

A big thanks to Roland Thiolliere (@RolT) for this fix!
2022-06-23 12:24:40 +02:00
Peter Taoussanis
ba8827708e v3.1.1 2020-11-18 2020-11-18 12:08:48 +01:00
Peter Taoussanis
ef8a9b659d Bump deps 2020-11-18 11:54:24 +01:00
Daniel Mason
8429814a65 [#138] Fix typo bug: medium keyword+symbol length fields should be a Short (@danmason)
Looks like a typo snuck in here and wasn't caught by tests since they didn't include
names >127 characters.
2020-11-18 11:51:34 +01:00
Peter Taoussanis
b61bf594a1 Update README to incl. java.time.Period example 2020-11-06 15:59:56 +01:00
Peter Taoussanis
79e78f1e51 v3.1.0 2020-11-06 2020-11-06 15:50:58 +01:00
Peter Taoussanis
97dd98ed43 Add default Serializable support for many standard java.time classes
Further additions welcome
2020-11-06 15:50:58 +01:00
Peter Taoussanis
043b37211d Add native support for java.time.Period 2020-11-06 15:50:58 +01:00
Peter Taoussanis
6dd21e0e15 Add native support for java.time.Duration 2020-11-06 15:50:58 +01:00
Peter Taoussanis
5097e16727 Bump Snappy test dependency (1.1.7.7 -> 1.1.8) 2020-11-06 15:50:53 +01:00
Peter Taoussanis
53a3c97edf Add (deprecated) swap-serializable-whitelist! for backwards compatibility 2020-11-06 15:34:18 +01:00
Peter Taoussanis
93755570a5 [#137] Add thaw-from-resource 2020-11-06 15:34:18 +01:00
Peter Taoussanis
a98b0d8bb1 java.time.Instant support housekeeping 2020-10-24 16:53:02 +02:00
Peter Taoussanis
32e4c13ca2 v3.1.0-RC1 2020-10-24 2020-10-24 14:38:10 +02:00
Peter Taoussanis
2203a4800c [#135 #128] Add support for java.time.Instant (@cnuernber) 2020-10-24 14:38:02 +02:00
Peter Taoussanis
5502e0d479 Misc housekeeping 2020-10-24 14:10:32 +02:00
Peter Taoussanis
d910654814 Bump deps 2020-10-24 12:25:29 +02:00