-
Notifications
You must be signed in to change notification settings - Fork 665
CBOR Feature Drop: COSE #2412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
CBOR Feature Drop: COSE #2412
Changes from 90 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
b1182ec
CBOR basic value tagging
JesusMcCloud 47d6233
CBOR: handle tagged keys
JesusMcCloud 87bcda3
CBOR: make verifying and writing tags optional
JesusMcCloud d3eac6b
CBOR: fix decoding value tags, add tests
JesusMcCloud 2788ec2
CBOR: refactor Tagged → ValueTags
JesusMcCloud c620fdb
CBOR: Fixes (docs, whitespace, names, superflous params)
JesusMcCloud 0d1b31b
CBOR: serialize cbor to tree
JesusMcCloud 4f82ec8
CBOR: tree fixes
JesusMcCloud 1356666
CBOR: frankensteined data tree
JesusMcCloud 76afa35
CBOR: fix direct encoding of primitives
JesusMcCloud ce9eefd
CBOR: write definite lengths
JesusMcCloud 8b328f4
CBOR: experiment with pruning null properties
JesusMcCloud ad97cbb
CBOR: Catch errors on finding annotations
nodh ef1f77d
CBOR: Implement labels to use as map keys
nodh 83824b6
WIP: Ignore failing tests
nodh eb73d7d
CBOR: Add option to write serial labels over names
nodh 53c8c42
CBOR: Add annotation @CborArray to encode classes as arrays
nodh 6a9bc52
CBOR: Add convenience class for wrapping byte strings during serializ…
nodh 03b7771
CBOR: Test combination of serial label with tags
nodh 86c7f82
CBOR: Add option to always use compact byte string encoding
nodh 82fb4be
CBOR: Fix potential issue with custom serializers
nodh af0b7a3
CBOR: Encode null complex object as empty map
nodh 6572245
CBOR: remove recursion and null pruning
JesusMcCloud 19eb85e
CBOR: remove bogus `explicitNulls`
JesusMcCloud 9c305f4
CBOR: streamline an simplify encoding
JesusMcCloud 72b61de
CBOR: minor cleanups
JesusMcCloud 972657d
CBOR: fix polymorphism
JesusMcCloud 93ffa7a
CBOR: document new features
JesusMcCloud 6bbffef
CBOR: run knit+ fix docs
JesusMcCloud 7625683
CBOR: update API dumps
JesusMcCloud addae47
CBOR: Provide serializer for ByteStringWrapper
nodh 13014d8
CBOR: Rename "SerialLabel" to "CborLabel"
nodh a389636
CBOR: Add documentation to CborLabel and CborArray
nodh 07463a1
CBOR: Suppress warning about desugared API on Android
nodh c1067f4
CBOR: remove Encoder class
JesusMcCloud 9418e2c
CBOR: don't preallocate for preamble
JesusMcCloud 42e9fe6
CBOR: don't preallocate for data
JesusMcCloud 290666a
CBOR: minor adjustments (missing docs, formatting, …)
JesusMcCloud 992a11a
CBOR: simplify encoding and comment data structures
JesusMcCloud e6ead57
CBOR: minor cleanups
JesusMcCloud 3fb8687
run knit
JesusMcCloud 71896a4
update API dump
JesusMcCloud 07ca549
CBOR: adapt CborArray annotation to avoid empty ULong varags
JesusMcCloud 8cb3d99
CBOR: split up encoder and decoder
JesusMcCloud ea64d54
CBOR: Partial performance optimization
JesusMcCloud 674426d
CBOR: simplify encoding
JesusMcCloud 7b745f5
CBOR: split up encoders
JesusMcCloud b86f5ca
CBOR: peak performance
JesusMcCloud d7397b2
CBOR: Update API Dump
JesusMcCloud 897ff72
CBOR: fix EncodingUtils
JesusMcCloud 8389089
CBOR: Clarify CborLabel docs
JesusMcCloud a45daf7
CBOR: remove unused functions
JesusMcCloud 00185f5
COSE: Remove ByteStringWrapper
JesusMcCloud dc07e3c
CBOR: document CborArray Tags annotation
JesusMcCloud 49b3ea2
CBOR: document predefined tags
JesusMcCloud aeb83cf
CBOR: revamp tagging
JesusMcCloud 682f363
CBOR: pull up encoder method
JesusMcCloud 3d8768c
CBOR: clode DefiniteLengthCborWriter
JesusMcCloud f4b43e7
CBOR: fix default instance writing and verifying tags
JesusMcCloud 13e2eb0
CBOR: fix: uncomment tag test
JesusMcCloud 2439e5e
CBOR: get labels only when preferred over serial names
JesusMcCloud 759ffce
CBOR: run knit and apiDump
JesusMcCloud 13e3d5a
CBOR: fix readme
JesusMcCloud 82f326f
CBOR: split encoder and decoder interfaces
JesusMcCloud 5697e3f
CBOR: Fix serialName encoding for absent labels
JesusMcCloud 62b80b5
CBOR: expose configuration flags as public properties
JesusMcCloud 176848c
CBOR: fix ExperimentalSerializationApi annotations
JesusMcCloud c55ab97
CBOR: fix missing API Docs
JesusMcCloud 7c25ffe
CBOR: remove unused helper function
JesusMcCloud b0cba73
CBOR: update apidump
JesusMcCloud ac17821
CBOR: try fix animalsniffer error
JesusMcCloud a1a7dad
CBOR: remove bogur runCatching
JesusMcCloud 3724fea
CBOR: SuppressAnimalSniffer
JesusMcCloud 3cec347
CBOR fix code comment
JesusMcCloud 1b8fba7
CBOR: Fix Docs
JesusMcCloud eb6ac40
CBOR: SuppressAnimalSniffer
JesusMcCloud 2fa4f88
CBOR: Add Encoder and Decoder superinterfaces to CborEncoder and Cbor…
JesusMcCloud d99999c
CBOR: rename configuration flags
JesusMcCloud e483c7f
CBOR: Refactor Tagging instance -> CoseCompliant
JesusMcCloud 00bcb68
CBOR: introduce CborConfiguration+ minor docs fixes
JesusMcCloud abf9a55
CBOR: move convenience methods used for testing to test sources
JesusMcCloud 1c1527c
CBOR: Fix index OOB error when decoding tags
JesusMcCloud 434ac38
CBOR fix and test against specific error messages
JesusMcCloud 8f1e33f
CBOR: fix error message grammar
JesusMcCloud b0d8885
CBOR: move convenience method used for testing to test sources
JesusMcCloud 86fc01b
CBOR: clarify and test object tags behaviour
JesusMcCloud 707b9b7
CBOR: Fix docs
JesusMcCloud 069fb77
CBOR: Fix Docs
JesusMcCloud 69ae08f
CBOR: fix builder switch names and polisch docs
JesusMcCloud 29b6605
CBOR: Update API dump and run knit
JesusMcCloud 2294cc7
CBOR: refactor CborImpl C'tor
JesusMcCloud 507ccd1
CBOR: remove superfluouos config switch for CborArrayTest
JesusMcCloud 15bbc3f
CBOR: mv CborDefLenTest -> CborDefiniteLengthTest
JesusMcCloud 46227cf
CBOR: Refactor Tests
JesusMcCloud 167877b
CBOR: polish CborConfiguration
JesusMcCloud 7ec8e02
CBOR: cleanup CborDecoder and CborParser
JesusMcCloud a272a2d
CBOR: Fix documentation
JesusMcCloud f12a5bf
CBOR: cleanup AnimalSniffer
JesusMcCloud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
benchmark/src/jmh/kotlin/kotlinx/benchmarks/cbor/CborBaseLine.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
| */ | ||
|
|
||
| package kotlinx.benchmarks.cbor | ||
|
|
||
| import kotlinx.serialization.Serializable | ||
| import kotlinx.serialization.cbor.* | ||
| import org.openjdk.jmh.annotations.* | ||
| import java.util.concurrent.* | ||
|
|
||
| @Serializable | ||
| data class KTestAllTypes( | ||
| val i32: Int, | ||
| val i64: Long, | ||
| val f: Float, | ||
| val d: Double, | ||
| val s: String, | ||
| val b: Boolean = false, | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class KTestOuterMessage( | ||
| val a: Int, | ||
| val b: Double, | ||
| val inner: KTestAllTypes, | ||
| val s: String, | ||
| val ss: List<String> | ||
| ) | ||
|
|
||
| @Warmup(iterations = 5, time = 1) | ||
| @Measurement(iterations = 10, time = 1) | ||
| @BenchmarkMode(Mode.Throughput) | ||
| @OutputTimeUnit(TimeUnit.MILLISECONDS) | ||
| @State(Scope.Benchmark) | ||
| @Fork(1) | ||
| open class CborBaseline { | ||
| val baseMessage = KTestOuterMessage( | ||
| 42, | ||
| 256123123412.0, | ||
| s = "string", | ||
| ss = listOf("a", "b", "c"), | ||
| inner = KTestAllTypes(-123124512, 36253671257312, Float.MIN_VALUE, -23e15, "foobarbaz") | ||
| ) | ||
|
|
||
| val cbor = Cbor { | ||
| encodeDefaults = true | ||
| encodeKeyTags = false | ||
| encodeValueTags = false | ||
| useDefiniteLengthEncoding = false | ||
| preferCborLabelsOverNames = false | ||
| } | ||
|
|
||
| val baseBytes = cbor.encodeToByteArray(KTestOuterMessage.serializer(), baseMessage) | ||
|
|
||
| @Benchmark | ||
| fun toBytes() = cbor.encodeToByteArray(KTestOuterMessage.serializer(), baseMessage) | ||
|
|
||
| @Benchmark | ||
| fun fromBytes() = cbor.decodeFromByteArray(KTestOuterMessage.serializer(), baseBytes) | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.