VB.NET Express speed issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Chambers

    #1

    VB.NET Express speed issue

    Hi,

    I've written a programme that processes stock market price data in
    VB.NET 2005 Express. I've optimised the code as much as possible, eg:-
    using arrays, not passing parameters to functions, etc...

    The code is slow because it is processing large amounts of data many
    many times.

    However, is there a way to compile the code to other formats to make it
    run faster? I've heard of C++ (too difficult for me).

    Does the Full Paid Version of VB.NET run code faster than the express
    version?

    Many thanks,
    Alex

  • David Browne

    #2
    Re: VB.NET Express speed issue


    "Ali Chambers" <info@alexchamb ers.co.ukwrote in message
    news:1155738324 .628507.280190@ h48g2000cwc.goo glegroups.com.. .
    Hi,
    >
    I've written a programme that processes stock market price data in
    VB.NET 2005 Express. I've optimised the code as much as possible, eg:-
    using arrays, not passing parameters to functions, etc...
    >
    The code is slow because it is processing large amounts of data many
    many times.
    >
    However, is there a way to compile the code to other formats to make it
    run faster? I've heard of C++ (too difficult for me).
    >
    Does the Full Paid Version of VB.NET run code faster than the express
    version?
    No it's the same. If you post a simple sample program that illustrates your
    performance problem you're likely to get some advice.

    David


    Comment

    • Chris Dunaway

      #3
      Re: VB.NET Express speed issue

      Ali Chambers wrote:
      I've written a programme that processes stock market price data in
      VB.NET 2005 Express. I've optimised the code as much as possible, eg:-
      using arrays, not passing parameters to functions, etc...
      Why would you think that passing parameters to functions would result
      in any appreciable performance loss?
      >
      The code is slow because it is processing large amounts of data many
      many times.
      >
      You say the code is slow, how did you measure this? What is the size
      of the data you are processing and how long does it take? How long do
      you think it *should* take? What is your basis for comparison?

      According to the 80/20 rule, the program spends 80% of the time in only
      20% of the code. That 20% of the code is what should be measured first
      and then the remaining code as needed. I suggest getting a code
      profiler and finding out where the bottlenecks actually lie and start
      your investigation there.

      Since .Net intermediate code is JIT compiled into native machine code,
      it should not run any slower than other code.

      Good Luck

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: VB.NET Express speed issue

        Ali,

        In addition to the others,

        I think that we are special intereste in that array part, because using real
        array's slows down often the process.

        All managed code program language from Microsoft create the same end code in
        every versie and run all at the same speed.

        Cor

        "Ali Chambers" <info@alexchamb ers.co.ukschree f in bericht
        news:1155738324 .628507.280190@ h48g2000cwc.goo glegroups.com.. .
        Hi,
        >
        I've written a programme that processes stock market price data in
        VB.NET 2005 Express. I've optimised the code as much as possible, eg:-
        using arrays, not passing parameters to functions, etc...
        >
        The code is slow because it is processing large amounts of data many
        many times.
        >
        However, is there a way to compile the code to other formats to make it
        run faster? I've heard of C++ (too difficult for me).
        >
        Does the Full Paid Version of VB.NET run code faster than the express
        version?
        >
        Many thanks,
        Alex
        >

        Comment

        • Ali Chambers

          #5
          Re: VB.NET Express speed issue

          Thanks for your help. I appreciate the programme may take a long time
          to run whatever the language.

          I wondered:

          a) If MS didn't allow "fast code optimisation" in VB Express - ie.
          force you to buy full product to get true speed realisation

          b) The code is as follows:

          - Price data is held in "double" floating point array, eg:-
          highprice(0-9999)
          - Comparisons are done between highprice(0-9999) and lowprice(0-9999)
          - Buy levels are determined and these buy points held in arrays
          - The programme then loops through the price arrays incrementally to
          find sell prices - at which it sells and records the price (a basic
          description!)

          Different levels for buy & selling are tested (too complicated for this
          email). On average, the buy/sell routine is called 3 million times per
          stock.

          c) Are there third party products to speed up the code?

          d) Or - off topic - would another language be better?

          Sorry - basic questions - but I'm a novice coder.

          Alex

          Comment

          • Patrice

            #6
            Re: VB.NET Express speed issue

            Looks rather you should review how you proceed (for example the "looping in
            an array to find" would make me think an arrayb is not the suitable data
            structurss for this particular part)... etc...

            --
            Patrice

            "Ali Chambers" <info@alexchamb ers.co.uka écrit dans le message de news:
            1155744811.4292 64.164460@i3g20 00...legro ups.com...
            Thanks for your help. I appreciate the programme may take a long time
            to run whatever the language.
            >
            I wondered:
            >
            a) If MS didn't allow "fast code optimisation" in VB Express - ie.
            force you to buy full product to get true speed realisation
            >
            b) The code is as follows:
            >
            - Price data is held in "double" floating point array, eg:-
            highprice(0-9999)
            - Comparisons are done between highprice(0-9999) and lowprice(0-9999)
            - Buy levels are determined and these buy points held in arrays
            - The programme then loops through the price arrays incrementally to
            find sell prices - at which it sells and records the price (a basic
            description!)
            >
            Different levels for buy & selling are tested (too complicated for this
            email). On average, the buy/sell routine is called 3 million times per
            stock.
            >
            c) Are there third party products to speed up the code?
            >
            d) Or - off topic - would another language be better?
            >
            Sorry - basic questions - but I'm a novice coder.
            >
            Alex
            >

            Comment

            • Ali Chambers

              #7
              Re: VB.NET Express speed issue

              Patrice - so what would you suggest then?

              Comment

              • Izzy

                #8
                Re: VB.NET Express speed issue

                Sounds to me like you need to store this information in a database and
                instead or incrementing through your array to match a specific value,
                you should just select it from among 3 million records.


                Ali Chambers wrote:
                Patrice - so what would you suggest then?

                Comment

                • Cor Ligthert [MVP]

                  #9
                  Re: VB.NET Express speed issue

                  Ali,

                  I said already Arrays are extremely slow to handle at least you can have a
                  look at the list classes from which the arraylist is the most simple one.

                  http://msdn.microsoft.com/library/de...classtopic.asp

                  But there are more advices given including that what you are asking now,
                  because your reaction I have the idea that you did read nothing of those..

                  Cor

                  "Ali Chambers" <info@alexchamb ers.co.ukschree f in bericht
                  news:1155744811 .429264.164460@ i3g2000cwc.goog legroups.com...
                  Thanks for your help. I appreciate the programme may take a long time
                  to run whatever the language.
                  >
                  I wondered:
                  >
                  a) If MS didn't allow "fast code optimisation" in VB Express - ie.
                  force you to buy full product to get true speed realisation
                  >
                  b) The code is as follows:
                  >
                  - Price data is held in "double" floating point array, eg:-
                  highprice(0-9999)
                  - Comparisons are done between highprice(0-9999) and lowprice(0-9999)
                  - Buy levels are determined and these buy points held in arrays
                  - The programme then loops through the price arrays incrementally to
                  find sell prices - at which it sells and records the price (a basic
                  description!)
                  >
                  Different levels for buy & selling are tested (too complicated for this
                  email). On average, the buy/sell routine is called 3 million times per
                  stock.
                  >
                  c) Are there third party products to speed up the code?
                  >
                  d) Or - off topic - would another language be better?
                  >
                  Sorry - basic questions - but I'm a novice coder.
                  >
                  Alex
                  >

                  Comment

                  • Michel Posseth  [MCP]

                    #10
                    Re: VB.NET Express speed issue

                    I would suggest a Hashtable or a database

                    if you really want to do everything in memory then a hashtable is the
                    fastest option

                    why is a hashtable faster as a "normall" array ( in fact is a hashtable a
                    special kind of array , same for collections and even datarows etc etc )
                    see this :



                    regards

                    Michel Posseth [MCP]




                    "Ali Chambers" <info@alexchamb ers.co.ukschree f in bericht
                    news:1155746373 .684860.16320@7 5g2000cwc.googl egroups.com...
                    Patrice - so what would you suggest then?
                    >

                    Comment

                    • Dennis

                      #11
                      Re: VB.NET Express speed issue

                      If you are using ReDim to resize your array when data is added, this is
                      extremely slow!
                      --
                      Dennis in Houston


                      "Ali Chambers" wrote:
                      Patrice - so what would you suggest then?
                      >
                      >

                      Comment

                      Working...