Commit Graph

152 Commits (52fb89ff7326b3570e9c42a435081dab559f610b)

Author SHA1 Message Date
Clayton Coleman bffbc112f0
Remove src and dest version - they are not used (now)
We will probably readd these as an opaque object passed down to
conversions that lets the caller get access to more info (like
a negotiated serializer).
2016-05-12 10:10:35 -04:00
Clayton Coleman 236925be87
Avoid allocations and a reflect.Call in conversion
reflect.Call is fairly expensive, performing 8 allocations and having to
set up a call stack. Using a fairly straightforward to generate switch
statement, we can bypass that early in conversion (as long as the
function takes responsibility for invocation). We may also be able to
avoid an allocation for the conversion scope, but not positive yet.

```
benchmark                    old ns/op     new ns/op     delta
BenchmarkPodConversion-8     14713         12173         -17.26%

benchmark                    old allocs     new allocs     delta
BenchmarkPodConversion-8     80             72             -10.00%

benchmark                    old bytes     new bytes     delta
BenchmarkPodConversion-8     9133          8712          -4.61%
```
2016-04-26 16:42:12 -04:00
Clayton Coleman 2f59744d53 Default conversion for byte slices is incorrect
Nil slices are getting allocated, which is incorrect and changes
behavior in some cases.

   []byte(nil) -> []byte(nil)
2016-04-17 21:20:50 -04:00
Wojciech Tyczynski 49d3c3962c Small improvements in conversion generator 2016-04-05 02:10:23 +02:00
harry b0900bf0d4 Refactor diff into sub pkg 2016-03-21 20:21:39 +08:00
Wojciech Tyczynski 7e2fdeae7b Regenerate autogenerate files 2016-03-17 15:22:19 +01:00
Wojciech Tyczynski e610c137c0 Regenerate auto-generated files 2016-03-17 09:30:02 +01:00
k8s-merge-robot d81d823ca5 Merge pull request #22393 from eparis/blunderbuss
Auto commit by PR queue bot
2016-03-02 18:51:56 -08:00
Eric Paris 5e5a823294 Move blunderbuss assignees into tree 2016-03-02 20:46:32 -05:00
Jordan Liggitt ea59b4c741 Fix sinceTime pod log options 2016-02-25 00:46:13 -05:00
Clayton Coleman 60b66665e1 Move conversion.Scheme to runtime
There is only one type registry to rule them all
2016-01-30 14:12:40 -05:00
Clayton Coleman 33085c0cf2 Update tests to handle codec changes 2016-01-22 13:27:26 -05:00
Clayton Coleman 4d127dc969 Initialize API servers with negotiated serializers
Pass down into the server initialization the necessary interface for
handling client/server content type negotiation. Add integration tests
for the negotiation.
2016-01-22 01:10:22 -05:00
Clayton Coleman c1d932e44a Switch API objects to not register per version codecs
Remove Codec from versionInterfaces in meta (RESTMapper is now agnostic
to codec and serialization). Register api/latest.Codecs as the codec
factory and use latest.Codecs.LegacyCodec(version) as an equvialent to
the previous codec.
2016-01-22 01:10:21 -05:00
Clayton Coleman 6582b4c2ea Remove codec awareness from conversion
Allow convertors to be specialized, some cleanup to how conversion
functions are stored internally to allow better reuse.
2016-01-21 23:18:32 -05:00
Clayton Coleman 3c1451af91 Use public conversion methods to avoid reflection
Replace many of the remaining s.Convert() invocations with direct
execution, and make generated methods public. Removes 10% of the
allocations during decode of a pod and ~20-40% of the total CPU time.
2015-12-29 10:38:42 -05:00
k8s-merge-robot ac0ce7257b Merge pull request #18702 from wojtek-t/remove_unversioned_selectors
Auto commit by PR queue bot
2015-12-23 09:51:53 -08:00
Wojciech Tyczynski 55747ec1ce Eliminate rubbish logs in pkg/conversion test 2015-12-22 16:07:30 +01:00
Wojciech Tyczynski 4aa2121a8e Remove dead code 2015-12-22 11:07:22 +01:00
k8s-merge-robot e309583ff1 Merge pull request #18473 from smarterclayton/change_runtime_object
Auto commit by PR queue bot
2015-12-16 04:24:22 -08:00
Clayton Coleman 8f203a28f1 Change runtime.Object signature 2015-12-15 13:36:25 -05:00
deads2k 6e33403abf update CodecFor for GroupVersion 2015-12-15 10:56:00 -05:00
Mike Danese 56bb8138bf remove merge conflict comments 2015-12-14 07:57:52 -08:00
Filip Grzadkowski 4ef062c22f Merge pull request #18476 from caesarxuchao/fix-query-convert
Fix queryparams convert
2015-12-14 13:22:27 +01:00
k8s-merge-robot 266ab4a796 Merge pull request #18487 from smarterclayton/guard_encode_decode
Auto commit by PR queue bot
2015-12-13 23:08:18 -08:00
Chao Xu 2eba8b7f1f fix queryparams convertStruct 2015-12-13 13:53:28 -08:00
Clayton Coleman 1e21054134 Hide common codec methods under helpers
The pending codec -> conversion split changes the signature of
Encode and Decode to be more complicated. Create a stub helper
with the exact semantics of today and do the simple mechanical
refactor here to reduce the cost of that change.
2015-12-09 21:15:02 -05:00
deads2k 519b4e80d1 update NewObject for groupversionkind 2015-12-09 08:13:15 -05:00
deads2k f764e0099c Update ObjectTyper to GroupVersion 2015-12-07 08:35:05 -05:00
Clayton Coleman a512d83a87 Skip SetVersionAndKind for ConvertToVersion to internal 2015-12-05 18:15:48 -05:00
deads2k ed95a6d77f update scheme to use GroupVersion 2015-11-25 12:15:48 -05:00
deads2k e0b7f52633 hack up queryToObject to continue to work as it used to 2015-11-25 12:14:06 -05:00
deads2k 68b0572974 internal versions 2015-11-25 12:14:06 -05:00
deads2k 6231404682 update decoder to use GroupVersion 2015-11-25 12:14:06 -05:00
Wojciech Tyczynski d7b098b0e9 Add DecodeParametersInto method to Codec. 2015-11-18 09:56:04 +01:00
feihujiang eac8d6a997 Cleanup the content of deprecated V1beta1 2015-11-06 13:42:51 +08:00
Chao Xu 69932aecb0 Let discoveryClient use RESTClient;
Ignore 403 and 404 error when discovering server-supported group/version
2015-10-29 09:55:32 -07:00
Wojciech Tyczynski f650abaafa Use ugorji/go/codec for decoding jsons. 2015-10-16 10:12:08 +02:00
Chao Xu f3caff2a79 testapi.Experimental -> testapi.Extensions 2015-10-09 15:15:35 -07:00
Chao Xu 347d53ff2e v1alpa1->v1beta1 2015-10-09 15:06:28 -07:00
Chao Xu 0b7e3c7dd1 experimental/v1alpha1->extensions/v1beta1 2015-10-09 15:01:33 -07:00
Brendan Burns 8998219686 Add a method for encoding directly to a io.Writer and use it for HTTPx 2015-09-24 15:52:09 -07:00
k8s-merge-robot 6d2c2440e9 Merge pull request #14203 from caesarxuchao/encode-unversioned
Auto commit by PR queue bot
2015-09-21 18:59:32 -07:00
Chao Xu ab5c1f6710 let encoder handle unversioned objects
address lavalamp's comments

address lavalamp's comments

address lavalamp's comments

add a TODO based on lavalamp's comment

add a TODO based on lavalamp's comment
2015-09-21 15:57:45 -07:00
Clayton Coleman a02bcefa10 Allow []string to be converted to *int64
Not something we hit before
2015-09-21 12:02:03 -04:00
liguangbo 4df68f03a3 change iff to if and only if to improve annotation readability 2015-09-16 08:29:36 +00:00
kargakis f9bca7bc7d handle structs 2015-09-03 15:49:24 +02:00
kargakis 6c32e071f4 Dont output nil; test nil & omitempty 2015-09-03 15:32:19 +02:00
kargakis edfaa480cf queryparams: Handle pointer fields in structs 2015-09-03 13:45:31 +02:00
Piotr Szczesniak eb01d49783 Merge pull request #12556 from uluyol/copynilinterface
Properly handle nil interfaces in DeepCopy.
2015-08-12 09:54:02 +02:00