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

T

Tom Siltwater

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
 
J

Jeff Clark

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

Mark Schupp

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.
 
B

Bob Barrows

Tom said:
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
 
B

Bob Barrows

Tom said:
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
 
T

Tom Siltwater

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
 
T

Tom Siltwater

Bob Barrows said:
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.
 
B

Bob Barrows

Tom said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top