Comments (9)
btw. offtopic but still related :-)
AFAIK NetSerializer is the fastest binary serializer in the world for .NET.
Using the POCO class in the perf test, Wire actually out performs it, and all the other serializers too.
Results change if the serialized object is smaller though.
from wire.
Any feedback on how we can improve this is welcome.
One thing that I am not sure how to solve is the concept of "Constant" in expressions, where you can bind an expression to an already existing object.
How would one go about to make the generated IL code get access to the external object?
it needs to be stored somewhere so the IL code can get to it I suppose.
from wire.
Related to #42
from wire.
cc @Scooletz I am working on an IL implementation of the ICompiler abstraction.
it can emit methods and some code already. but far from complete.
please have a look and see
https://github.com/akkadotnet/Wire/blob/dev/Wire/Compilation/IlExpression.cs
https://github.com/akkadotnet/Wire/blob/dev/Wire/Compilation/IlCompiler.cs
https://github.com/akkadotnet/Wire/blob/dev/Wire.Tests/IlCompilerTests.cs
Do you think this is something we can work with? at least as a start to get going?
I'm hesitant to bring in Sigil as that will bring more dependencies. I would like to stay clean and lightweight. and the code we need to generate is not that complex.
from wire.
I took a quick look. It looks promising and yes, I wouldn't bring in Sigil. I was referring to it only as a good approach towards emitting. Another one would be the EmitContext
from protobuf-net
. Your proposal looks very good as well.
I'm taking a few days off but will try to catch up either today in the evening (GMT+2) or tomorrow (evening as well).
from wire.
IlCompiler
is now complete enough that it can compile the _read
and _write
in the session aware/unaware serializers.
it still causes "destabilize runtime" if used on the read and write generators in DefaultCodeGenerator
.
I guess there is some issue with boxing/unboxing.
from wire.
I've got a few questions after reading the code more carefully:
- Is
IlCompiler<Del>
is meant to replaceCompiler<Del>
at the end? - Does is suffer from the "destabilize runtime" still? Tests on
dev
are all green. - Have you checked if the static calls for the primitive value serializered are inlined? If not, I'll check it with
BenchmarkDotNet
. It seems to me that it's the last thing we could improve for primitive serializers.
from wire.
- That was the idea, but I'm not sure if the effort is worth it (?)
- There seems to be some strangeness still going on, it actually makes the testrunner stop before all tests are done. not sure exactly what makes it blow up yet. (when using the IlCompiler instead of Combiler inside DefaultCodeGenerator)
- I'm not sure how to check that they are inlined as inlining only affects the Jitter (afaik). adding aggressive inlining to the the static methods seems to do nothing for the perf.
If the inlining does not occur, I think it would be possible to do it in the Emit phase, right?
from wire.
I'm mostly offline this week but will take a look next week and try to finalize this approach. I think that JIL optimization, ordering properties by type to get a better memory alignment could bump up the perf again.
from wire.
Related Issues (20)
- NVM
- Serialization of F# Map HOT 4
- No support for struct with a non-default constructor? HOT 8
- Is Serializer thread safe? HOT 2
- AmbiguousMatchException when serializing a type with multiple AddRange methods HOT 1
- Invalid code generation on fields of interface type HOT 5
- Wire performance improvements HOT 3
- CollectionTests.CanSerializeDictionaryKeysAndValuesByteChar is failing HOT 1
- Wire 0.8.2 is not compatible with 0.8.1 HOT 6
- Stack overflow when serializing/deserializing LinkedList
- OSS license for Wire HOT 2
- Support for IDictionary HOT 3
- Serialize - DeSerialize between similar types. HOT 4
- Speedup dials to compare performance with bond simple binary protocol.
- .NET Core serialization issues
- Signed Wire NuGet package
- support DataContract/DataMember/IgnoreDataMember
- Does wire do zig-zag / 7bit encoding?
- Wire.Extensions.TypeEx CoreAssemblyName ignore mscorelib/System.Private.CoreLib
- .NET Core 3 - Cannot Deserialize
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wire.