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. General Programming
  3. C#
  4. how to make an application so fast, in terms of speed

how to make an application so fast, in terms of speed

Scheduled Pinned Locked Moved C#
csharpsysadminalgorithmsperformancetutorial
7 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.
  • D Offline
    D Offline
    devesh_code
    wrote on last edited by
    #1

    Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks

    Devesh Mishra

    C L H 3 Replies Last reply
    0
    • D devesh_code

      Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks

      Devesh Mishra

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

      As opposed to fast in terms of.... ? If it searches the same machines over and over, you can build an index on those machines and search that instead. If the machines change, you can buy faster network cards.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      D 1 Reply Last reply
      0
      • C Christian Graus

        As opposed to fast in terms of.... ? If it searches the same machines over and over, you can build an index on those machines and search that instead. If the machines change, you can buy faster network cards.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        D Offline
        D Offline
        devesh_code
        wrote on last edited by
        #3

        Thanks for your reply. I am searching the network computers from the network directory. Its not searching the same machine over and over. Now tell me that how can i improve the speed or is there any other way to search the network computers. Thanks

        Devesh Mishra

        1 Reply Last reply
        0
        • D devesh_code

          Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks

          Devesh Mishra

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          You could rely on the information Windows itself is holding; see several CP articles, e.g. http://www.codeproject.com/useritems/ExplorerTree.asp[^] If you want to discover network computers yourself (say with ping), you must avoid doing it completely sequentially; so you may want to use a couple of threads (I suggest no more than 4), as has been the topic of many forum items before. :)

          Luc Pattyn [My Articles] [Forum Guidelines]

          1 Reply Last reply
          0
          • D devesh_code

            Hello I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed. Thanks

            Devesh Mishra

            H Offline
            H Offline
            Hesham Yassin
            wrote on last edited by
            #5

            aHi, i think you need to start several threads at once!

            D 1 Reply Last reply
            0
            • H Hesham Yassin

              aHi, i think you need to start several threads at once!

              D Offline
              D Offline
              devesh_code
              wrote on last edited by
              #6

              Hi Thanks for ur reply.. But plz tell me that how can i start multiple thread at once... Thanks

              Devesh Mishra

              H 1 Reply Last reply
              0
              • D devesh_code

                Hi Thanks for ur reply.. But plz tell me that how can i start multiple thread at once... Thanks

                Devesh Mishra

                H Offline
                H Offline
                Hesham Yassin
                wrote on last edited by
                #7

                there are many kinds of threads: the basic one is : private void MethodA() { System.Threading.Thread t1 = new Thread(new ThreadStart(MethodB)) System.Threading.Thread t2 = new Thread(new ThreadStart(MethodC)) } private void MethodB() { // Do some work } private void MethodC() { // Do some work } if the methods that you want to call have input, so you need to use a parametrized thread : using System; using System.Threading; public class Work { public static void Main() { // To start a thread using a shared thread procedure, use // the class name and method name when you create the // ParameterizedThreadStart delegate. // Thread newThread = new Thread( new ParameterizedThreadStart(Work.DoWork)); // Use the overload of the Start method that has a // parameter of type Object. You can create an object that // contains several pieces of data, or you can pass any // reference type or value type. The following code passes // the integer value 42. // newThread.Start(42); // To start a thread using an instance method for the thread // procedure, use the instance variable and method name when // you create the ParameterizedThreadStart delegate. // Work w = new Work(); newThread = new Thread( new ParameterizedThreadStart(w.DoMoreWork)); // Pass an object containing data for the thread. // newThread.Start("The answer."); } public static void DoWork(object data) { Console.WriteLine("Static thread procedure. Data='{0}'", data); } public void DoMoreWork(object data) { Console.WriteLine("Instance thread procedure. Data='{0}'", data); } } /* This code example produces the following output (the order of the lines might vary): Static thread procedure. Data='42' Instance thread procedure. Data='The answer' */ For more examples, search in the MSDN Library ;)

                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