I just spent several hours shaving a total of 250 milliseconds off my application

Discussion in 'ASP General' started by Tom Siltwater, Oct 30, 2003.

  1. building variable width/DB tables etc using getrows instead of movenext.
    Performance is a major concern as this app requires SSL.

    My question is, when does it become more about the challenge of building
    faster apps vs. getting the job done??? If my calculations are correct, I
    just added an extra 10,000+ possible hits within a 12 hour day or so.. an
    extra 10,000 hits???!!! What percentage of applications do you think will
    ever see this kind of traffic?

    Is this insane? If this app ever gets maxed out, will my end users ever
    realistically notice a difference?


    TIA
    Tom Siltwater, Oct 30, 2003
    #1
    1. Advertising

  2. Tom Siltwater

    Jeff Clark Guest

    The exercise you went through will lead to more efficient insane and
    pointless programming in the future.



    "Tom Siltwater" <> wrote in message
    news:...
    >
    > building variable width/DB tables etc using getrows instead of movenext.
    > Performance is a major concern as this app requires SSL.
    >
    > My question is, when does it become more about the challenge of building
    > faster apps vs. getting the job done??? If my calculations are correct, I
    > just added an extra 10,000+ possible hits within a 12 hour day or so.. an
    > extra 10,000 hits???!!! What percentage of applications do you think will
    > ever see this kind of traffic?
    >
    > Is this insane? If this app ever gets maxed out, will my end users ever
    > realistically notice a difference?
    >
    >
    > TIA
    >
    >
    Jeff Clark, Oct 30, 2003
    #2
    1. Advertising

  3. Tom Siltwater

    Mark Schupp Guest

    It was probably worthwhile to learn the technique so that you can apply it
    in similar situations in the future.

    In general you should apply the same rules of performance optimization that
    are used in non-web apps. Profile the application to see where the users
    spend most of their time and concentrate your efforts on that portion of the
    application. If you shave 250ms second off of a page the gets hit once an
    hour you've wasted your time. If it gets hit 10 times a second then you've
    made a significant improvement in performance.

    When developing new pages or making major changes to old pages use the
    optimization techniques that you have learned.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Tom Siltwater" <> wrote in message
    news:...
    >
    > building variable width/DB tables etc using getrows instead of movenext.
    > Performance is a major concern as this app requires SSL.
    >
    > My question is, when does it become more about the challenge of building
    > faster apps vs. getting the job done??? If my calculations are correct, I
    > just added an extra 10,000+ possible hits within a 12 hour day or so.. an
    > extra 10,000 hits???!!! What percentage of applications do you think will
    > ever see this kind of traffic?
    >
    > Is this insane? If this app ever gets maxed out, will my end users ever
    > realistically notice a difference?
    >
    >
    > TIA
    >
    >
    Mark Schupp, Oct 31, 2003
    #3
  4. Tom Siltwater

    Bob Barrows Guest

    Tom Siltwater wrote:
    > building variable width/DB tables etc using getrows instead of
    > movenext. Performance is a major concern as this app requires SSL.
    >
    > My question is, when does it become more about the challenge of
    > building faster apps vs. getting the job done??? If my calculations
    > are correct, I just added an extra 10,000+ possible hits within a 12
    > hour day or so.. an extra 10,000 hits???!!! What percentage of
    > applications do you think will ever see this kind of traffic?
    >
    > Is this insane? If this app ever gets maxed out, will my end users
    > ever realistically notice a difference?
    >
    >
    > TIA


    I don't get it. Why do you say it took so much longer using a getrows array
    vs a recordset loop?

    Recordset loop:

    if not rs.eof then
    Do until rs.eof
    rs.movenext
    loop
    else
    'handle no-records event
    end if
    rs.close:set rs=nothing
    cn.close:set cn=nothing

    GetRows array loop:

    if not rs.eof then arResults-rs.getrows
    rs.close:set rs=nothing
    cn.close:set cn=nothing
    if isarray(arResults) then
    for i = 0 to ubound(arResults,2)
    next
    else
    'handle no-records event
    end if


    9 lines vs 9 lines. Where is the increase in development time?

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows, Oct 31, 2003
    #4
  5. Tom Siltwater

    Bob Barrows Guest

    Tom Siltwater wrote:
    > building variable width/DB tables etc using getrows instead of
    > movenext. Performance is a major concern as this app requires SSL.
    >
    > My question is, when does it become more about the challenge of
    > building faster apps vs. getting the job done??? If my calculations
    > are correct, I just added an extra 10,000+ possible hits within a 12
    > hour day or so.. an extra 10,000 hits???!!! What percentage of
    > applications do you think will ever see this kind of traffic?
    >
    > Is this insane? If this app ever gets maxed out, will my end users
    > ever realistically notice a difference?
    >

    Just wanted to add: while you may have improved performance by "only" 250ms
    for this page, you are ignoring the fact that you have improved the overall
    utilization of connections on your server by releasing connections before
    processing the data. So there will be improved performance and less
    resources used on your server overall as a result of this development
    method.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows, Oct 31, 2003
    #5
  6. thanks :)

    "Jeff Clark" <JeffC@NO_SPAMreturnventures.com> wrote in message
    news:...
    > The exercise you went through will lead to more efficient insane and
    > pointless programming in the future.
    >
    >
    >
    > "Tom Siltwater" <> wrote in message
    > news:...
    > >
    > > building variable width/DB tables etc using getrows instead of movenext.
    > > Performance is a major concern as this app requires SSL.
    > >
    > > My question is, when does it become more about the challenge of building
    > > faster apps vs. getting the job done??? If my calculations are correct,

    I
    > > just added an extra 10,000+ possible hits within a 12 hour day or so..

    an
    > > extra 10,000 hits???!!! What percentage of applications do you think

    will
    > > ever see this kind of traffic?
    > >
    > > Is this insane? If this app ever gets maxed out, will my end users ever
    > > realistically notice a difference?
    > >
    > >
    > > TIA
    > >
    > >

    >
    >
    Tom Siltwater, Oct 31, 2003
    #6
  7. I'm just now getting to the "tweaking" stage of scripting. Before it was all
    about just getting it to work. I made an error with my performance
    estimate.. it's actually running 3x faster than rs.movenext..! That put a
    big smile on my face last night after all that struggling.

    Thanks for the advice


    "Mark Schupp" <> wrote in message
    news:O4c1$...
    > It was probably worthwhile to learn the technique so that you can apply it
    > in similar situations in the future.
    >
    > In general you should apply the same rules of performance optimization

    that
    > are used in non-web apps. Profile the application to see where the users
    > spend most of their time and concentrate your efforts on that portion of

    the
    > application. If you shave 250ms second off of a page the gets hit once an
    > hour you've wasted your time. If it gets hit 10 times a second then you've
    > made a significant improvement in performance.
    >
    > When developing new pages or making major changes to old pages use the
    > optimization techniques that you have learned.
    >
    > --
    > Mark Schupp
    > Head of Development
    > Integrity eLearning
    > www.ielearning.com
    >
    >
    > "Tom Siltwater" <> wrote in message
    > news:...
    > >
    > > building variable width/DB tables etc using getrows instead of movenext.
    > > Performance is a major concern as this app requires SSL.
    > >
    > > My question is, when does it become more about the challenge of building
    > > faster apps vs. getting the job done??? If my calculations are correct,

    I
    > > just added an extra 10,000+ possible hits within a 12 hour day or so..

    an
    > > extra 10,000 hits???!!! What percentage of applications do you think

    will
    > > ever see this kind of traffic?
    > >
    > > Is this insane? If this app ever gets maxed out, will my end users ever
    > > realistically notice a difference?
    > >
    > >
    > > TIA
    > >
    > >

    >
    >
    Tom Siltwater, Oct 31, 2003
    #7
  8. "Bob Barrows" <> wrote in message
    news:...
    > Tom Siltwater wrote:
    > > building variable width/DB tables etc using getrows instead of
    > > movenext. Performance is a major concern as this app requires SSL.
    > >
    > > My question is, when does it become more about the challenge of
    > > building faster apps vs. getting the job done??? If my calculations
    > > are correct, I just added an extra 10,000+ possible hits within a 12
    > > hour day or so.. an extra 10,000 hits???!!! What percentage of
    > > applications do you think will ever see this kind of traffic?
    > >
    > > Is this insane? If this app ever gets maxed out, will my end users
    > > ever realistically notice a difference?
    > >
    > >
    > > TIA

    >
    > I don't get it. Why do you say it took so much longer using a getrows

    array
    > vs a recordset loop?
    >
    > Recordset loop:
    >
    > if not rs.eof then
    > Do until rs.eof
    > rs.movenext
    > loop
    > else
    > 'handle no-records event
    > end if
    > rs.close:set rs=nothing
    > cn.close:set cn=nothing
    >
    > GetRows array loop:
    >
    > if not rs.eof then arResults-rs.getrows
    > rs.close:set rs=nothing
    > cn.close:set cn=nothing
    > if isarray(arResults) then
    > for i = 0 to ubound(arResults,2)
    > next
    > else
    > 'handle no-records event
    > end if
    >
    >
    > 9 lines vs 9 lines. Where is the increase in development time?
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >




    It's actually just over a hundred lines of code. I'm using a single function
    to dynamically build tables which takes 10 different arguments for column
    widths, height, table headers, anchor tags etc etc.. just about every page
    within the site will use this function now.
    Tom Siltwater, Oct 31, 2003
    #8
  9. Tom Siltwater

    Bob Barrows Guest

    Tom Siltwater wrote:

    >
    > It's actually just over a hundred lines of code. I'm using a single
    > function to dynamically build tables which takes 10 different
    > arguments for column widths, height, table headers, anchor tags etc
    > etc.. just about every page within the site will use this function
    > now.


    I still don't see where you did anything "extra" by using getrows vs a
    recordset loop. You would have had to write this function in either case
    wouldn't you? I can see using maybe 5 or 6 extra lines to create an array to
    contain the recordset's metadata if you need to use that, but ... 100 extra
    lines because you're using getrows vs a recordset loop? I don't understand.

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows, Nov 1, 2003
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob
    Replies:
    31
    Views:
    1,015
    Nick Malik
    Jul 16, 2004
  2. davidw
    Replies:
    3
    Views:
    414
    Curt_C [MVP]
    Aug 27, 2004
  3. Rahmi Acar
    Replies:
    0
    Views:
    560
    Rahmi Acar
    Jul 17, 2003
  4. Steven D'Aprano

    A tale of yak shaving

    Steven D'Aprano, Aug 29, 2011, in forum: Python
    Replies:
    1
    Views:
    193
    Seebs
    Aug 30, 2011
  5. rutherf
    Replies:
    2
    Views:
    425
    rutherf
    Oct 28, 2006
Loading...

Share This Page