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. Web Development
  3. ASP.NET
  4. Is there any performance issue in it

Is there any performance issue in it

Scheduled Pinned Locked Moved ASP.NET
dockerperformancehelpquestion
10 Posts 4 Posters 0 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 Offline
    S Offline
    Sandeep Akhare
    wrote on last edited by
    #1

    Hi All, I have one doubt i have a data container class Applicant.i have created many objects of other classes like PersonalInfo,Employment..... etc in the constructor of applicant. Now the question is there any performace issue while using these 2 sentnces string Address = applicantObject.PersonalInfo.Address; Or should do in another way PersonalInfo personalInfoObject=applicantObject.PersonalInfo; string Address=personalInfoObject.Address; Is there any perforamance between 2 Address is a property it might have many properties Can any one give me the link where i can read performance issue for this type

    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

    C N P 3 Replies Last reply
    0
    • S Sandeep Akhare

      Hi All, I have one doubt i have a data container class Applicant.i have created many objects of other classes like PersonalInfo,Employment..... etc in the constructor of applicant. Now the question is there any performace issue while using these 2 sentnces string Address = applicantObject.PersonalInfo.Address; Or should do in another way PersonalInfo personalInfoObject=applicantObject.PersonalInfo; string Address=personalInfoObject.Address; Is there any perforamance between 2 Address is a property it might have many properties Can any one give me the link where i can read performance issue for this type

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Option 2 creates another reference to a class, or another copy of a struct. Either way, this is not going to have a huge hit.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      S 1 Reply Last reply
      0
      • S Sandeep Akhare

        Hi All, I have one doubt i have a data container class Applicant.i have created many objects of other classes like PersonalInfo,Employment..... etc in the constructor of applicant. Now the question is there any performace issue while using these 2 sentnces string Address = applicantObject.PersonalInfo.Address; Or should do in another way PersonalInfo personalInfoObject=applicantObject.PersonalInfo; string Address=personalInfoObject.Address; Is there any perforamance between 2 Address is a property it might have many properties Can any one give me the link where i can read performance issue for this type

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        I don't think this would be a performance issue.

        playing with bugs ) wrote:

        string Address = applicantObject.PersonalInfo.Address;

        This will create a memory space for address and store the value.

        playing with bugs ) wrote:

        PersonalInfo personalInfoObject=applicantObject.PersonalInfo; string Address=personalInfoObject.Address;

        This will create another location on the stack and refer to the specified object. In this also new location for string would be created. This won't be a big performance issue.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        S 1 Reply Last reply
        0
        • C Christian Graus

          Option 2 creates another reference to a class, or another copy of a struct. Either way, this is not going to have a huge hit.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          Hi Chris, Thanks for reply, Here all are reference type(Class) so you are right option 2 creates pointer to same memory.

          Christian Graus wrote:

          Either way, this is not going to have a huge hit.

          Is CLR is going to call these 2 sentences in same way ?

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          1 Reply Last reply
          0
          • N N a v a n e e t h

            I don't think this would be a performance issue.

            playing with bugs ) wrote:

            string Address = applicantObject.PersonalInfo.Address;

            This will create a memory space for address and store the value.

            playing with bugs ) wrote:

            PersonalInfo personalInfoObject=applicantObject.PersonalInfo; string Address=personalInfoObject.Address;

            This will create another location on the stack and refer to the specified object. In this also new location for string would be created. This won't be a big performance issue.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Hey Navaneeth !!!!! Thanks for you valuable comments. But if you see the how CLR going to call these 2 sentences i think that makes the difference

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            N 1 Reply Last reply
            0
            • S Sandeep Akhare

              Hey Navaneeth !!!!! Thanks for you valuable comments. But if you see the how CLR going to call these 2 sentences i think that makes the difference

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              playing with bugs ) wrote:

              But if you see the how CLR going to call these 2 sentences i think that makes the difference

              I am not getting how this can make a performance difference ? What made you to think so ?

              All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

              S 1 Reply Last reply
              0
              • N N a v a n e e t h

                playing with bugs ) wrote:

                But if you see the how CLR going to call these 2 sentences i think that makes the difference

                I am not getting how this can make a performance difference ? What made you to think so ?

                All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                S Offline
                S Offline
                Sandeep Akhare
                wrote on last edited by
                #7

                Just wanted to know is there performace issue in it. i think you are right there is not much difference in both Thanks

                Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                N 1 Reply Last reply
                0
                • S Sandeep Akhare

                  Just wanted to know is there performace issue in it. i think you are right there is not much difference in both Thanks

                  Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                  N Offline
                  N Offline
                  N a v a n e e t h
                  wrote on last edited by
                  #8

                  Although, if it makes any extra performance, it would be very less and negligible. Those two are two types of approach to the problem.

                  All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                  1 Reply Last reply
                  0
                  • S Sandeep Akhare

                    Hi All, I have one doubt i have a data container class Applicant.i have created many objects of other classes like PersonalInfo,Employment..... etc in the constructor of applicant. Now the question is there any performace issue while using these 2 sentnces string Address = applicantObject.PersonalInfo.Address; Or should do in another way PersonalInfo personalInfoObject=applicantObject.PersonalInfo; string Address=personalInfoObject.Address; Is there any perforamance between 2 Address is a property it might have many properties Can any one give me the link where i can read performance issue for this type

                    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                    P Offline
                    P Offline
                    Paddy Boyd
                    wrote on last edited by
                    #9

                    Choose whatever way is going to be the easiest to read. The performance differences will be negligible in the big picture, but if you 'pre-optimise' your code too much, you could go back to it in a years time and have no idea what you were trying to do... keep it simple.

                    S 1 Reply Last reply
                    0
                    • P Paddy Boyd

                      Choose whatever way is going to be the easiest to read. The performance differences will be negligible in the big picture, but if you 'pre-optimise' your code too much, you could go back to it in a years time and have no idea what you were trying to do... keep it simple.

                      S Offline
                      S Offline
                      Sandeep Akhare
                      wrote on last edited by
                      #10

                      Very well said Paddy :)

                      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                      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