Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Well done .NET!...

Well done .NET!...

Scheduled Pinned Locked Moved The Lounge
csharpcollaborationjsonperformancehelp
26 Posts 14 Posters 35 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Super Lloyd

    3. there is no serializer in Silverlight! but Emit and Reflection do exist! So I can use my serializer on silverlight! :-) And it is supposed to serialize as well as the .NET one!

    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.

    B Offline
    B Offline
    BruceCarson
    wrote on last edited by
    #7

    Do people actually use that cruft (Silverlight)?

    B S T 4 Replies Last reply
    0
    • B BruceCarson

      Do people actually use that cruft (Silverlight)?

      B Offline
      B Offline
      blackjack2150
      wrote on last edited by
      #8

      I am. I'm currently learning it, but the project I will work on will be coded with Silverlight3, RIA Services and Prism. Not my choices, but I'm happy to learn new stuff after almost 3 years of doing boring .NET 2.0 console apps.

      1 Reply Last reply
      0
      • B BruceCarson

        Do people actually use that cruft (Silverlight)?

        S Offline
        S Offline
        Super Lloyd
        wrote on last edited by
        #9

        Well, while my spare time pet project to take over the world is still a while away, I'm already thinking to have a Silverlight we demo! Other than that in my work we just started to investigate Silverlight for some stuff. I should say I'm disappointed so far that much desktop code can't just be recompiled under silverlight, maybe I was hoping for too much... Maybe XBAP is more appropriate for us... Anyway, mmh... not that I have used it.. but I bought the marketing pitch! :-) Yea, I know, I'm soo naive! :laugh:

        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.

        1 Reply Last reply
        0
        • B BruceCarson

          Do people actually use that cruft (Silverlight)?

          S Offline
          S Offline
          Super Lloyd
          wrote on last edited by
          #10

          BTW Silverlight 3 is way more modern than Silverlight 1 (or even 2)

          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.

          B 1 Reply Last reply
          0
          • B BruceCarson

            So what's the problem with the default one? I've hit a few issues myself and always managed to get around them...:cool:

            D Offline
            D Offline
            Dave Parker
            wrote on last edited by
            #11

            I wrote my own some time ago because back then the compact framework didn't have serialization. I'd expect the default one to be faster really, it's probably written at least partially in C/C++ with some slowing safety checks switched off and optimized well as it's expected to be used in a lot of places, etc. I've never been in a situation where the performance (either of the default or of my custom) has been an issue though so haven't ran any speed tests.

            S 1 Reply Last reply
            0
            • S Super Lloyd

              BTW Silverlight 3 is way more modern than Silverlight 1 (or even 2)

              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.

              B Offline
              B Offline
              BruceCarson
              wrote on last edited by
              #12

              Super Lloyd wrote:

              BTW Silverlight 3 is way more modern than Silverlight 1 (or even 2)

              I have a (bad) habit of looking a MS technologies when they first come out. A couple of days invested there seems like a good plan. Unfortunately, MS has this tendency to "reinvent" the technology and just up the version number (and make the product actually good!). And here I am stuck with my 1.0 impressions :sigh: I actually had someone tell me that Sharepoint was actually usable now! Now you're telling me that Silverlight is at least "OK"! I guess it's time to take another look.

              R 1 Reply Last reply
              0
              • B BruceCarson

                Super Lloyd wrote:

                BTW Silverlight 3 is way more modern than Silverlight 1 (or even 2)

                I have a (bad) habit of looking a MS technologies when they first come out. A couple of days invested there seems like a good plan. Unfortunately, MS has this tendency to "reinvent" the technology and just up the version number (and make the product actually good!). And here I am stuck with my 1.0 impressions :sigh: I actually had someone tell me that Sharepoint was actually usable now! Now you're telling me that Silverlight is at least "OK"! I guess it's time to take another look.

                R Offline
                R Offline
                Rocky Moore
                wrote on last edited by
                #13

                BruceCarson wrote:

                And here I am stuck with my 1.0 impressions

                That would be bad with Silverlight since it did not have .NET included in 1.0, just Javascript :)

                Rocky <>< Recent Blog Post: Chocolate Chip Cookies!

                1 Reply Last reply
                0
                • D Dave Parker

                  I wrote my own some time ago because back then the compact framework didn't have serialization. I'd expect the default one to be faster really, it's probably written at least partially in C/C++ with some slowing safety checks switched off and optimized well as it's expected to be used in a lot of places, etc. I've never been in a situation where the performance (either of the default or of my custom) has been an issue though so haven't ran any speed tests.

                  S Offline
                  S Offline
                  Super Lloyd
                  wrote on last edited by
                  #14

                  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.

                  D 1 Reply Last reply
                  0
                  • S Super Lloyd

                    2 issues: 1. it throws exceptions when deserializing (if there is a problem) (while I was planning to simply drop value) (but because it is so fast to start with, that's not really a problem) 2. It serialize whole object, in my serializer I was adding an option to drop any object of ignored type (as defined by the user). The idea was to drop delegates! Why that? I'm writing a modular application which takes 3rd party data and serialize them. I don't want to have inappropriate data due to dangling event handler... if I just drop them the 3rd party developer will quickly realize the problem during his tests. But comes to think of it, UI element are not serializable. That will throw exception during the save process and hint the developer to fix that. And remove a big chunk of typical event listener source. Maybe it's not all so bad... mmm.... Now, anyway, I'd like to know how come they do that so fast!!!! maybe I could improve the speed with some security demand? This was a very teaching experience so far (my 1st emit 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.

                    W Offline
                    W Offline
                    wout de zeeuw
                    wrote on last edited by
                    #15

                    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

                    S 1 Reply Last reply
                    0
                    • B BruceCarson

                      Do people actually use that cruft (Silverlight)?

                      T Offline
                      T Offline
                      ToddHileHoffer
                      wrote on last edited by
                      #16

                      No. It is used to play videos on web pages. That is about it.

                      I didn't get any requirements for the signature

                      1 Reply Last reply
                      0
                      • W wout de zeeuw

                        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

                        S Offline
                        S Offline
                        Super Lloyd
                        wrote on last edited by
                        #17

                        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.

                        1 Reply Last reply
                        0
                        • S Super Lloyd

                          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.

                          J Offline
                          J Offline
                          Jim Matthews
                          wrote on last edited by
                          #18

                          welcome to the bizzaro lounge. :cool:


                          jim

                          1 Reply Last reply
                          0
                          • S Super Lloyd

                            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.

                            N Offline
                            N Offline
                            Nemanja Trifunovic
                            wrote on last edited by
                            #19

                            Super Lloyd wrote:

                            How could they do that! It's so unfair!

                            Run ILDasm and find out how they did it :)

                            Programming Blog utf8-cpp

                            S 1 Reply Last reply
                            0
                            • S Super Lloyd

                              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.

                              E Offline
                              E Offline
                              Ennis Ray Lynch Jr
                              wrote on last edited by
                              #20

                              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

                              S 1 Reply Last reply
                              0
                              • OriginalGriffO OriginalGriff

                                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

                                O Offline
                                O Offline
                                originSH
                                wrote on last edited by
                                #21

                                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

                                1 Reply Last reply
                                0
                                • S Super Lloyd

                                  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.

                                  R Offline
                                  R Offline
                                  Rajesh R Subramanian
                                  wrote on last edited by
                                  #22

                                  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

                                  1 Reply Last reply
                                  0
                                  • S Super Lloyd

                                    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.

                                    D Offline
                                    D Offline
                                    Dave Parker
                                    wrote on last edited by
                                    #23

                                    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.

                                    1 Reply Last reply
                                    0
                                    • E Ennis Ray Lynch Jr

                                      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

                                      S Offline
                                      S Offline
                                      Super Lloyd
                                      wrote on last edited by
                                      #24

                                      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.

                                      1 Reply Last reply
                                      0
                                      • N Nemanja Trifunovic

                                        Super Lloyd wrote:

                                        How could they do that! It's so unfair!

                                        Run ILDasm and find out how they did it :)

                                        Programming Blog utf8-cpp

                                        S Offline
                                        S Offline
                                        Super Lloyd
                                        wrote on last edited by
                                        #25

                                        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.

                                        1 Reply Last reply
                                        0
                                        • OriginalGriffO OriginalGriff

                                          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

                                          M Offline
                                          M Offline
                                          Mark_Wallace
                                          wrote on last edited by
                                          #26

                                          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!

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups