By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 1,837 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

performance question

P: n/a
Lets just say my app is done HOO HOO.

Now, I'm accessing the database via a web service and one thing i noticed
that my app is running real slow. When I first started working on the app is
ran pretty quick returned the data to the screens in about 2 - 3 seconds. Now
its going about 5 - 10 seconds. How can I beef it up for better performance.
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
> Lets just say my app is done HOO HOO.

I hate it when my app is done HOO HOO. But what are you going to do? Live it
or live with it, as the young lady says...

;-)

Performance. This is one of the reasons why Uncle Chutney says "Big things
are made up of lots of little things." In a client-server app, this is
especially true. Small increases or decreases in performance can make a big
difference when a lot of clients are accessing a web app. Multiply the
difference in performance by the number of clients, and you can see why.

There are lots of little things you can do to dramatically increase
performance. I'll try to hit the big ones.

1. In a client-server app, any work done by the client means a big savings
on the server. The more clients the bigger the savings. Use client-side
processing and JavaScript whenever possible.
2. If your App is written in VB.Net, make sure that Option Strict is turned
ON! Late-binding is anathema to performance.
3. Avoid duplication in your app. Don't duplicate values, and don't
duplicate code. Any time you see the same few lines of code in several
places, you're looking at a good candidate for a function or Sub. If you
have created a number of classes that have the same fields, properties,
and/or methods, you're looking at a good candidate for a base class, and
derived classes.
4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
quite useful; others are one-size-fits-all memory hogs for beginners, to
make it easy for them to make something happen without much trouble.
5. Close and/or Dispose any objects that use unmanaged resources as quickly
as possible.
6. Close database connections ASAP.

On a similar note, it should be stressed that performance is a factor in
designing your app. The fastest apps have much more lower-level code in
them, and are also more proprietary overall. Writing an app that is easily
extensible may involve a trade-off of performance over code maintainability.
Striking the right balance is an art.

I'm sure I've overlooked several things, but I do believe I've hit on the
majors in this list. At any rate, I hope it helps.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
Lets just say my app is done HOO HOO.

Now, I'm accessing the database via a web service and one thing i noticed
that my app is running real slow. When I first started working on the app is ran pretty quick returned the data to the screens in about 2 - 3 seconds. Now its going about 5 - 10 seconds. How can I beef it up for better performance.

Nov 18 '05 #2

P: n/a
All good points. Actually all the db connections are closed and all the db
transactions are being done in the web service. The html(aspx) pages call the
function needed and then i do formatting on the aspx pages, such as the
datagrids.
The only question i have it the Option Strict. I turned that ON and when I
recompiled the project. I got all kinds of errors such as

Option Strict On Disallows implicit conversions from 'String' to 'Short'

how do i fix that?

"Kevin Spencer" wrote:
Lets just say my app is done HOO HOO.


I hate it when my app is done HOO HOO. But what are you going to do? Live it
or live with it, as the young lady says...

;-)

Performance. This is one of the reasons why Uncle Chutney says "Big things
are made up of lots of little things." In a client-server app, this is
especially true. Small increases or decreases in performance can make a big
difference when a lot of clients are accessing a web app. Multiply the
difference in performance by the number of clients, and you can see why.

There are lots of little things you can do to dramatically increase
performance. I'll try to hit the big ones.

1. In a client-server app, any work done by the client means a big savings
on the server. The more clients the bigger the savings. Use client-side
processing and JavaScript whenever possible.
2. If your App is written in VB.Net, make sure that Option Strict is turned
ON! Late-binding is anathema to performance.
3. Avoid duplication in your app. Don't duplicate values, and don't
duplicate code. Any time you see the same few lines of code in several
places, you're looking at a good candidate for a function or Sub. If you
have created a number of classes that have the same fields, properties,
and/or methods, you're looking at a good candidate for a base class, and
derived classes.
4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
quite useful; others are one-size-fits-all memory hogs for beginners, to
make it easy for them to make something happen without much trouble.
5. Close and/or Dispose any objects that use unmanaged resources as quickly
as possible.
6. Close database connections ASAP.

On a similar note, it should be stressed that performance is a factor in
designing your app. The fastest apps have much more lower-level code in
them, and are also more proprietary overall. Writing an app that is easily
extensible may involve a trade-off of performance over code maintainability.
Striking the right balance is an art.

I'm sure I've overlooked several things, but I do believe I've hit on the
majors in this list. At any rate, I hope it helps.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
Lets just say my app is done HOO HOO.

Now, I'm accessing the database via a web service and one thing i noticed
that my app is running real slow. When I first started working on the app

is
ran pretty quick returned the data to the screens in about 2 - 3 seconds.

Now
its going about 5 - 10 seconds. How can I beef it up for better

performance.


Nov 18 '05 #3

P: n/a
Dim x as string = "99"
Dim y as short = CType(x, Short)
OR
Dim y as short = CShort(x)

You'll use a lot of CType with Option Strict On, but it is worth the extra
effort.

Greg

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
All good points. Actually all the db connections are closed and all the db
transactions are being done in the web service. The html(aspx) pages call
the
function needed and then i do formatting on the aspx pages, such as the
datagrids.
The only question i have it the Option Strict. I turned that ON and when I
recompiled the project. I got all kinds of errors such as

Option Strict On Disallows implicit conversions from 'String' to 'Short'

how do i fix that?

"Kevin Spencer" wrote:
> Lets just say my app is done HOO HOO.


I hate it when my app is done HOO HOO. But what are you going to do? Live
it
or live with it, as the young lady says...

;-)

Performance. This is one of the reasons why Uncle Chutney says "Big
things
are made up of lots of little things." In a client-server app, this is
especially true. Small increases or decreases in performance can make a
big
difference when a lot of clients are accessing a web app. Multiply the
difference in performance by the number of clients, and you can see why.

There are lots of little things you can do to dramatically increase
performance. I'll try to hit the big ones.

1. In a client-server app, any work done by the client means a big
savings
on the server. The more clients the bigger the savings. Use client-side
processing and JavaScript whenever possible.
2. If your App is written in VB.Net, make sure that Option Strict is
turned
ON! Late-binding is anathema to performance.
3. Avoid duplication in your app. Don't duplicate values, and don't
duplicate code. Any time you see the same few lines of code in several
places, you're looking at a good candidate for a function or Sub. If you
have created a number of classes that have the same fields, properties,
and/or methods, you're looking at a good candidate for a base class, and
derived classes.
4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
quite useful; others are one-size-fits-all memory hogs for beginners, to
make it easy for them to make something happen without much trouble.
5. Close and/or Dispose any objects that use unmanaged resources as
quickly
as possible.
6. Close database connections ASAP.

On a similar note, it should be stressed that performance is a factor in
designing your app. The fastest apps have much more lower-level code in
them, and are also more proprietary overall. Writing an app that is
easily
extensible may involve a trade-off of performance over code
maintainability.
Striking the right balance is an art.

I'm sure I've overlooked several things, but I do believe I've hit on the
majors in this list. At any rate, I hope it helps.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
> Lets just say my app is done HOO HOO.
>
> Now, I'm accessing the database via a web service and one thing i
> noticed
> that my app is running real slow. When I first started working on the
> app

is
> ran pretty quick returned the data to the screens in about 2 - 3
> seconds.

Now
> its going about 5 - 10 seconds. How can I beef it up for better

performance.
>
>


Nov 18 '05 #4

P: n/a
That worked on the one error.
Now i'm getting Option Strict On disallows Late binding.
I'm doing some formatting of the datagrids based on certain data that is
returned.

How can i fix that issue now?
I need to format the grids based on the data being returned

"Greg Burns" wrote:
Dim x as string = "99"
Dim y as short = CType(x, Short)
OR
Dim y as short = CShort(x)

You'll use a lot of CType with Option Strict On, but it is worth the extra
effort.

Greg

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
All good points. Actually all the db connections are closed and all the db
transactions are being done in the web service. The html(aspx) pages call
the
function needed and then i do formatting on the aspx pages, such as the
datagrids.
The only question i have it the Option Strict. I turned that ON and when I
recompiled the project. I got all kinds of errors such as

Option Strict On Disallows implicit conversions from 'String' to 'Short'

how do i fix that?

"Kevin Spencer" wrote:
> Lets just say my app is done HOO HOO.

I hate it when my app is done HOO HOO. But what are you going to do? Live
it
or live with it, as the young lady says...

;-)

Performance. This is one of the reasons why Uncle Chutney says "Big
things
are made up of lots of little things." In a client-server app, this is
especially true. Small increases or decreases in performance can make a
big
difference when a lot of clients are accessing a web app. Multiply the
difference in performance by the number of clients, and you can see why.

There are lots of little things you can do to dramatically increase
performance. I'll try to hit the big ones.

1. In a client-server app, any work done by the client means a big
savings
on the server. The more clients the bigger the savings. Use client-side
processing and JavaScript whenever possible.
2. If your App is written in VB.Net, make sure that Option Strict is
turned
ON! Late-binding is anathema to performance.
3. Avoid duplication in your app. Don't duplicate values, and don't
duplicate code. Any time you see the same few lines of code in several
places, you're looking at a good candidate for a function or Sub. If you
have created a number of classes that have the same fields, properties,
and/or methods, you're looking at a good candidate for a base class, and
derived classes.
4. Avoid using the "drag and drop" tools in the toolbox. Some of them are
quite useful; others are one-size-fits-all memory hogs for beginners, to
make it easy for them to make something happen without much trouble.
5. Close and/or Dispose any objects that use unmanaged resources as
quickly
as possible.
6. Close database connections ASAP.

On a similar note, it should be stressed that performance is a factor in
designing your app. The fastest apps have much more lower-level code in
them, and are also more proprietary overall. Writing an app that is
easily
extensible may involve a trade-off of performance over code
maintainability.
Striking the right balance is an art.

I'm sure I've overlooked several things, but I do believe I've hit on the
majors in this list. At any rate, I hope it helps.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
> Lets just say my app is done HOO HOO.
>
> Now, I'm accessing the database via a web service and one thing i
> noticed
> that my app is running real slow. When I first started working on the
> app
is
> ran pretty quick returned the data to the screens in about 2 - 3
> seconds.
Now
> its going about 5 - 10 seconds. How can I beef it up for better
performance.
>
>


Nov 18 '05 #5

P: n/a
Hi Mike,
The only question i have it the Option Strict. I turned that ON and when I
recompiled the project. I got all kinds of errors such as
Awesome! Sounds like you're coming from a VB background. Option Strict
ensures that you use correct data types in your code. The difference between
late and early binding is that Late Binding means that your app explicitly
declares data types, and doesn't mix and match them. This way, the app
already knows at run-time how much memory to allocate for each object. When
late-binding is used, the data type of an object may NOT be known at
run-time, and the Platform has to figure out how much memory to allocate by
calculation, which often involves the use of Reflection. It can slow your
app down quite a bit.

The errors can be fixed by going through your code, and making sure that you
explicitly declare the correct data type for each field, property, or
variable that you are using. Also, avoid the use of the "Object" data type.
Object is the base class for ALL data types, and is therefore a
"late-binding class." So, for example, here is a field and Property declared
with no Data Types:

Private _DayOfWeek = 1
Public Property DayofWeek
Get
Return _DayOfWeek
End Get
Set (ByVal Value)
_DayOfWeek = Value
End Set
End Property

Using this (Option Strinct OFF), you could assign a TexBox value (always a
string) to DayOfWeek, and it would compile fine. At run-time, the String
would have to be converted to a number by the Platform.

Instead, you would put (Option Strict ON):

Private _DayOfWeek As Short = 1
Public Property DayofWeek As Short
Get
Return _DayOfWeek
End Get
Set (ByVal Value As Short)
_DayOfWeek = Value
End Set
End Property

Your code will compile fine, as long as nothing in your code tries to assign
a String to DayOfWeek. You will get a "Data Type Mismatch" error if you do.

As I'm sure you can see, this also prevents a lot of errors (assigning a
non-numeric string to be used as a Short, for example), as well as informing
the Platform to allocate 16 Bits for _DayOfWeek.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com... All good points. Actually all the db connections are closed and all the db
transactions are being done in the web service. The html(aspx) pages call the function needed and then i do formatting on the aspx pages, such as the
datagrids.
The only question i have it the Option Strict. I turned that ON and when I
recompiled the project. I got all kinds of errors such as

Option Strict On Disallows implicit conversions from 'String' to 'Short'

how do i fix that?

"Kevin Spencer" wrote:
Lets just say my app is done HOO HOO.


I hate it when my app is done HOO HOO. But what are you going to do? Live it or live with it, as the young lady says...

;-)

Performance. This is one of the reasons why Uncle Chutney says "Big things are made up of lots of little things." In a client-server app, this is
especially true. Small increases or decreases in performance can make a big difference when a lot of clients are accessing a web app. Multiply the
difference in performance by the number of clients, and you can see why.

There are lots of little things you can do to dramatically increase
performance. I'll try to hit the big ones.

1. In a client-server app, any work done by the client means a big savings on the server. The more clients the bigger the savings. Use client-side
processing and JavaScript whenever possible.
2. If your App is written in VB.Net, make sure that Option Strict is turned ON! Late-binding is anathema to performance.
3. Avoid duplication in your app. Don't duplicate values, and don't
duplicate code. Any time you see the same few lines of code in several
places, you're looking at a good candidate for a function or Sub. If you
have created a number of classes that have the same fields, properties,
and/or methods, you're looking at a good candidate for a base class, and
derived classes.
4. Avoid using the "drag and drop" tools in the toolbox. Some of them are quite useful; others are one-size-fits-all memory hogs for beginners, to
make it easy for them to make something happen without much trouble.
5. Close and/or Dispose any objects that use unmanaged resources as quickly as possible.
6. Close database connections ASAP.

On a similar note, it should be stressed that performance is a factor in
designing your app. The fastest apps have much more lower-level code in
them, and are also more proprietary overall. Writing an app that is easily extensible may involve a trade-off of performance over code maintainability. Striking the right balance is an art.

I'm sure I've overlooked several things, but I do believe I've hit on the majors in this list. At any rate, I hope it helps.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
Lets just say my app is done HOO HOO.

Now, I'm accessing the database via a web service and one thing i noticed that my app is running real slow. When I first started working on the
app is
ran pretty quick returned the data to the screens in about 2 - 3
seconds. Now
its going about 5 - 10 seconds. How can I beef it up for better

performance.


Nov 18 '05 #6

P: n/a
Please post some code.

Greg

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
That worked on the one error.
Now i'm getting Option Strict On disallows Late binding.
I'm doing some formatting of the datagrids based on certain data that is
returned.

How can i fix that issue now?
I need to format the grids based on the data being returned

"Greg Burns" wrote:
Dim x as string = "99"
Dim y as short = CType(x, Short)
OR
Dim y as short = CShort(x)

You'll use a lot of CType with Option Strict On, but it is worth the
extra
effort.

Greg

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
> All good points. Actually all the db connections are closed and all the
> db
> transactions are being done in the web service. The html(aspx) pages
> call
> the
> function needed and then i do formatting on the aspx pages, such as the
> datagrids.
> The only question i have it the Option Strict. I turned that ON and
> when I
> recompiled the project. I got all kinds of errors such as
>
> Option Strict On Disallows implicit conversions from 'String' to
> 'Short'
>
> how do i fix that?
>
> "Kevin Spencer" wrote:
>
>> > Lets just say my app is done HOO HOO.
>>
>> I hate it when my app is done HOO HOO. But what are you going to do?
>> Live
>> it
>> or live with it, as the young lady says...
>>
>> ;-)
>>
>> Performance. This is one of the reasons why Uncle Chutney says "Big
>> things
>> are made up of lots of little things." In a client-server app, this is
>> especially true. Small increases or decreases in performance can make
>> a
>> big
>> difference when a lot of clients are accessing a web app. Multiply the
>> difference in performance by the number of clients, and you can see
>> why.
>>
>> There are lots of little things you can do to dramatically increase
>> performance. I'll try to hit the big ones.
>>
>> 1. In a client-server app, any work done by the client means a big
>> savings
>> on the server. The more clients the bigger the savings. Use
>> client-side
>> processing and JavaScript whenever possible.
>> 2. If your App is written in VB.Net, make sure that Option Strict is
>> turned
>> ON! Late-binding is anathema to performance.
>> 3. Avoid duplication in your app. Don't duplicate values, and don't
>> duplicate code. Any time you see the same few lines of code in several
>> places, you're looking at a good candidate for a function or Sub. If
>> you
>> have created a number of classes that have the same fields,
>> properties,
>> and/or methods, you're looking at a good candidate for a base class,
>> and
>> derived classes.
>> 4. Avoid using the "drag and drop" tools in the toolbox. Some of them
>> are
>> quite useful; others are one-size-fits-all memory hogs for beginners,
>> to
>> make it easy for them to make something happen without much trouble.
>> 5. Close and/or Dispose any objects that use unmanaged resources as
>> quickly
>> as possible.
>> 6. Close database connections ASAP.
>>
>> On a similar note, it should be stressed that performance is a factor
>> in
>> designing your app. The fastest apps have much more lower-level code
>> in
>> them, and are also more proprietary overall. Writing an app that is
>> easily
>> extensible may involve a trade-off of performance over code
>> maintainability.
>> Striking the right balance is an art.
>>
>> I'm sure I've overlooked several things, but I do believe I've hit on
>> the
>> majors in this list. At any rate, I hope it helps.
>>
>> --
>> HTH,
>> Kevin Spencer
>> ..Net Developer
>> Microsoft MVP
>> I get paid good money to
>> solve puzzles for a living
>>
>> "Mike" <Mi**@discussions.microsoft.com> wrote in message
>> news:1D**********************************@microsof t.com...
>> > Lets just say my app is done HOO HOO.
>> >
>> > Now, I'm accessing the database via a web service and one thing i
>> > noticed
>> > that my app is running real slow. When I first started working on
>> > the
>> > app
>> is
>> > ran pretty quick returned the data to the screens in about 2 - 3
>> > seconds.
>> Now
>> > its going about 5 - 10 seconds. How can I beef it up for better
>> performance.
>> >
>> >
>>
>>
>>


Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.