Well done .NET!...
-
Do people actually use that cruft (Silverlight)?
No. It is used to play videos on web pages. That is about it.
I didn't get any requirements for the signature
-
What I always do is this to not serialize event handlers (but not sure if this is what you were looking for):
\[field: NonSerialized\] public event EventHandler Modified;
Wout
Doing that you control the serialization of your classes. But in my case I want to drop delegate from 3rd party data structure! I can't tag their code! ;)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
For my own pet project to take over the world in my spare time, I was, this week, rewriting a BinarySerializer from scratch. Almost there, only "the Deserializer left to do". I'm caching dynamically generated method to access all field, I did a good encoding. In my little serializing (only so far) tests I was 20% smaller than the .NET default serialization! :-) Out of curiosity I just did a speed test... Ho man... The build in .NET serialization is .... 12 times faster! :sigh: (i.e. what I do in 12 seconds, they do in just 1, just be unambiguously clear). How could they do that! It's so unfair! :omg: Ho well I will just go with the default serialization and try to work around the little issue it has... And... well done the .NET team! :cool:
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
welcome to the bizzaro lounge. :cool:
jim
-
For my own pet project to take over the world in my spare time, I was, this week, rewriting a BinarySerializer from scratch. Almost there, only "the Deserializer left to do". I'm caching dynamically generated method to access all field, I did a good encoding. In my little serializing (only so far) tests I was 20% smaller than the .NET default serialization! :-) Out of curiosity I just did a speed test... Ho man... The build in .NET serialization is .... 12 times faster! :sigh: (i.e. what I do in 12 seconds, they do in just 1, just be unambiguously clear). How could they do that! It's so unfair! :omg: Ho well I will just go with the default serialization and try to work around the little issue it has... And... well done the .NET team! :cool:
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Super Lloyd wrote:
How could they do that! It's so unfair!
Run ILDasm and find out how they did it :)
-
For my own pet project to take over the world in my spare time, I was, this week, rewriting a BinarySerializer from scratch. Almost there, only "the Deserializer left to do". I'm caching dynamically generated method to access all field, I did a good encoding. In my little serializing (only so far) tests I was 20% smaller than the .NET default serialization! :-) Out of curiosity I just did a speed test... Ho man... The build in .NET serialization is .... 12 times faster! :sigh: (i.e. what I do in 12 seconds, they do in just 1, just be unambiguously clear). How could they do that! It's so unfair! :omg: Ho well I will just go with the default serialization and try to work around the little issue it has... And... well done the .NET team! :cool:
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Are you using c++ and memory mapped IO?
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
Super Lloyd wrote:
I'd like to know how come they do that so fast
Do you really think .NET is written in .NET? Or the (much faster) native code? :laugh:
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
Native code is generally a bit faster, but not massive amounts. It also depends alot on what you're doing, there are situations where managed code can be faster than native oweing to the optimisation at runtime that can be smart and machine specific. Also if you go the whole hog and make everything managed then you can do stuff like disabling hardware memory protection which can yield massive performance increases. Of course these are currently limited to research OSs like singularity and midori. And yes, the vast majority of .Net is written in .Net :P
-
Well, most .NET is written in .NET! (Except some very low level building block..) But anyway, from a quick look in Reflector, it looks like the .NET Serialization in indeed written mostly in .NET (and use heaps of classes!)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Super Lloyd wrote:
from a quick look in Reflector, it looks like the .NET Serialization in indeed written mostly in .NET
And was that written in .NET or C++? Stop being silly and just accept it. My compiler compiled your compiler.
It is a crappy thing, but it's life -^ Carlo Pallini
-
I'm not at the point where I could make an informed statement (for my pet project in my spare time to take over the world), however all the data would be saved by using serialization (not the whole data at once, mind you, just chunks of it. but all of it in chunk). Hence I guess the faster the better to provide a snazzy user experience. A x10 speed difference is a clear no brainer!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Yeah well kinda depends on how much you're serializing I guess as to whether its an issue or not. Whenever I've serialized / deserialized its seemed instaneous - less than 0.1 of a second anyway even for a fair amount of data on a mobile device. But if its a lot of data and/or being done very regularly then I guess speed is more important. I have some stats somewhere at work from when I did some speed tests on something that, as part of what it did, serialized 2 objects for the purpose of comparing them. I think it was using the built-in binary serialization. I can't remember exactly how fast it was but it could run thousands of times per second if not a lot more. In my case I was running it on every key press to determine whether the data had changed from the original in order to gray out / re-enable a save button based on whether the record was dirty. I'd be more worried about memory usage due to temporary objects being created and hanging around until garbage collected but it never became an issue anyway.
-
Are you using c++ and memory mapped IO?
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
I'm using C# and MemoryStream! ;-)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
Super Lloyd wrote:
How could they do that! It's so unfair!
Run ILDasm and find out how they did it :)
Yep I have to do that... Although I might use Reflector[^] instead! But I already had a glance and they use so many classes! Ha well, I guess nothings comes easily... :-D
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
Super Lloyd wrote:
I'd like to know how come they do that so fast
Do you really think .NET is written in .NET? Or the (much faster) native code? :laugh:
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
OriginalGriff wrote:
Do you really think .NET is written in .NET?
If you dig deep enough, you find the underlying COBOL commands.
I wanna be a eunuchs developer! Pass me a bread knife!