Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Aug 27, 2014
2 parents dd40f67 + 814899b commit 38aa334
Show file tree
Hide file tree
Showing 11 changed files with 487 additions and 373 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,26 @@
> This project uses [Break Versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md) as of **Aug 16, 2014**.
## v2.7.0-RC1 / 2014 Aug 27

> **Major release** with significant performance improvements, a new default compression type ([LZ4](http://blog.jpountz.net/post/28092106032/wow-lz4-is-fast)), and better support for a variety of compression/encryption tools.
>
> The data format is fully **backwards-compatible**, the API is backwards compatible **unless** you are using the `:headerless-meta` thaw option.
### Changes

* A number of internal performance improvements.
* Added [LZ4](http://blog.jpountz.net/post/28092106032/wow-lz4-is-fast) compressor, **replacing Snappy as the default** (often ~10+% faster with similar compression ratios). **Thanks to [mpenet](https://github.com/mpenet) for his work on this**!
* **BREAKING**: the `thaw` `:headerless-meta` option has been dropped. Its purpose was to provide Nippy v1 compatibility, which is now done automatically. To prevent any surprises, `thaw` calls with this option will now **throw an assertion error**.
* **IMPORTANT**: the `thaw` API has been improved (simplified). The default `:encryptor` and `:compressor` values are now both `:auto`, which'll choose intelligently based on data now included with the Nippy header. Behaviour remains the same for data written without a header: you must specify the correct `:compressor` and `:encryptor` values manually.
* Promoted from Alpha status: `taoensso.nippy.compression` ns, `taoensso.nippy.encryption` ns, `taoensso.nippy.tools` ns, `extend-freeze`, `extend-thaw`.
* All Nippy exceptions are now `ex-info`s.
* `extend-thaw` now prints a warning when replacing a pre-existing type id.

### NEW

* #50: `extend-freeze`, `extend-thaw` can now take arbitrary keyword type ids (see docstrings for more info).


## v2.6.3 / 2014 Apr 29

* Fix #48: broken freeze/thaw identity for empty lazy seqs (@vgeshel).
Expand Down
20 changes: 11 additions & 9 deletions README.md
@@ -1,10 +1,11 @@
**[API docs][]** | **[CHANGELOG][]** | [other Clojure libs][] | [Twitter][] | [contact/contributing](#contact--contributing) | current ([semantic][]) version:
**[API docs][]** | **[CHANGELOG][]** | [other Clojure libs][] | [Twitter][] | [contact/contrib](#contact--contributing) | current [Break Version][]:

```clojure
[com.taoensso/nippy "2.6.3"] ; Stable (please upgrade from v2.6.0 ASAP)
[com.taoensso/nippy "2.6.3"] ; Stable
[com.taoensso/nippy "2.7.0-RC1"] ; Development
```

v2.6 is a **major, backwards-compatible release** with: improved performance (incl. frozen data size), a new low-level DataInput/DataOuput API, improved support for headerless freezing, and 1-to-1 binary-value representation guarantees. See the [CHANGELOG][] for details.
v2.7 is a major, **mostly backwards-compatible** release focused on improved performance and a new default compression scheme (LZ4). See the [CHANGELOG][] for details. Thanks to [mpenet](https://github.com/mpenet) for his work on the LZ4 support!

# Nippy, a Clojure serialization library

Expand Down Expand Up @@ -115,9 +116,9 @@ Couldn't be simpler!

See also the lower-level `freeze-to-out!` and `thaw-from-in!` fns for operating on `DataOutput` and `DataInput` types directly.

### Encryption (currently in **ALPHA**)
### Encryption (v2+)

Nippy v2+ also gives you **dead simple data encryption**. Add a single option to your usual freeze/thaw calls like so:
Nippy also gives you **dead simple data encryption**. Add a single option to your usual freeze/thaw calls like so:

```clojure
(nippy/freeze nippy/stress-data {:password [:salted "my-password"]}) ; Encrypt
Expand All @@ -126,16 +127,16 @@ Nippy v2+ also gives you **dead simple data encryption**. Add a single option to

There's two default forms of encryption on offer: `:salted` and `:cached`. Each of these makes carefully-chosen trade-offs and is suited to one of two common use cases. See the `aes128-encryptor` [docstring](http://ptaoussanis.github.io/nippy/taoensso.nippy.encryption.html) for a detailed explanation of why/when you'd want one or the other.

### Custom types (v2.1+, ALPHA - subject to change)
### Custom types (v2.1+)

```clojure
(defrecord MyType [data])

(nippy/extend-freeze MyType 1 ; A unique type id ∈[1, 128]
(nippy/extend-freeze MyType :my-type/foo ; A unique (namespaced) type identifier
[x data-output]
(.writeUTF data-output (:data x)))

(nippy/extend-thaw 1 ; Same type id
(nippy/extend-thaw :my-type/foo ; Same type id
[data-input]
(->MyType (.readUTF data-input)))

Expand Down Expand Up @@ -166,7 +167,8 @@ Copyright © 2012-2014 Peter Taoussanis. Distributed under the [Eclipse Publ
[CHANGELOG]: <https://github.com/ptaoussanis/nippy/releases>
[other Clojure libs]: <https://www.taoensso.com/clojure-libraries>
[Twitter]: <https://twitter.com/ptaoussanis>
[semantic]: <http://semver.org/>
[SemVer]: <http://semver.org/>
[Break Version]: <https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md>
[Leiningen]: <http://leiningen.org/>
[CDS]: <http://clojure-doc.org/>
[ClojureWerkz]: <http://clojurewerkz.org/>
Expand Down
Binary file modified benchmarks.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 21 additions & 23 deletions project.clj
@@ -1,4 +1,4 @@
(defproject com.taoensso/nippy "2.6.3"
(defproject com.taoensso/nippy "2.7.0-SNAPSHOT"
:author "Peter Taoussanis <https://www.taoensso.com>"
:description "Clojure serialization library"
:url "https://github.com/ptaoussanis/nippy"
Expand All @@ -9,44 +9,42 @@
:min-lein-version "2.3.3"
:global-vars {*warn-on-reflection* true
*assert* true}

:dependencies
[[org.clojure/clojure "1.4.0"]
[org.clojure/tools.reader "0.8.3"]
[com.taoensso/encore "1.3.1"]
[org.clojure/tools.reader "0.8.7"]
[com.taoensso/encore "1.7.1"]
[org.iq80.snappy/snappy "0.3"]
[org.tukaani/xz "1.5"]]
[org.tukaani/xz "1.5"]
[net.jpountz.lz4/lz4 "1.2.0"]]

:test-paths ["test" "src"]
:profiles
{;; :default [:base :system :user :provided :dev]
:server-jvm {:jvm-opts ^:replace ["-server" "-Xms1024m" "-Xmx2048m"]}
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
:test {:jvm-opts ["-Xms1024m" "-Xmx2048m"]
:dependencies [[expectations "1.4.56"]
[org.clojure/test.check "0.5.7"]
:dependencies [[expectations "2.0.9"]
[org.clojure/test.check "0.5.9"]
;; [com.cemerick/double-check "0.5.7"]
[org.clojure/data.fressian "0.2.0"]
[org.xerial.snappy/snappy-java "1.1.1-M1"]]
:plugins [[lein-expectations "0.0.8"]
[lein-autoexpect "1.2.2"]]}
:dev* [:dev {:jvm-opts ^:replace ["-server"]
;; :hooks [cljx.hooks leiningen.cljsbuild] ; cljx
}]
:dev
[:1.6 :test
{:jvm-opts ^:replace ["-server" "-Xms1024m" "-Xmx2048m"]
:dependencies []
:plugins [[lein-ancient "0.5.4"]
[codox "0.6.7"]]}]}
[org.xerial.snappy/snappy-java "1.1.1.3"]]}
:dev [:1.6 :test
{:plugins
[[lein-pprint "1.1.1"]
[lein-ancient "0.5.5"]
[lein-expectations "0.0.8"]
[lein-autoexpect "1.2.2"]
[codox "0.8.10"]]}]}

:test-paths ["test" "src"]

;; :codox {:sources ["target/classes"]} ; cljx
:aliases
{"test-all" ["with-profile" "default:+1.5:+1.6" "expectations"]
;; "test-all" ["with-profile" "default:+1.6" "expectations"]
"test-auto" ["with-profile" "+test" "autoexpect"]
;; "build-once" ["do" "cljx" "once," "cljsbuild" "once"] ; cljx
;; "deploy-lib" ["do" "build-once," "deploy" "clojars," "install"] ; cljx
"deploy-lib" ["do" "deploy" "clojars," "install"]
"start-dev" ["with-profile" "+dev*" "repl" ":headless"]}
"start-dev" ["with-profile" "+server-jvm" "repl" ":headless"]}

:repositories
{"sonatype"
Expand Down

0 comments on commit 38aa334

Please sign in to comment.