Design question for the WebService Experts... - DOTNET
This is a discussion on Design question for the WebService Experts... - DOTNET ; Cool, I found the link...had to do a little searching but there was a lot of
good stuff. . From the post I was responding to, I couldn't get the context
but I figured it was the overhead of the ...
-
Re: Design question for the WebService Experts...
Cool, I found the link...had to do a little searching but there was a lot of
good stuff. . From the post I was responding to, I couldn't get the context
but I figured it was the overhead of the exception that accounted for a
dramatic difference b/c doing the check has to be only a fraction as
expensive as an exception.
Thanks for the answer though!
"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1afe4136cb7a915398a7ff@msnews.microsoft.com...
> William Ryan eMVP <dotnetguru@comcast.nospam.net> wrote:
> > Is that across the board (if for instance no exceptions are caught)?
I'm
> > just wondering b/c exceptions aren't cheap, and it makes sense that an
> > evaluation would be a lot cheaper than an exception, but assuming that
there
> > is no exception, does that still hold?
>
> If no exception is thrown, yes, it would be slower to run a pre-check.
> I suspect the proportion of "bad" numbers to "good" numbers where it's
> worth pre-checking is pretty small though. My benchmark had a 4:5
> valid:invalid ratio, and just using the exception was over 100 times
> slower than doing a pre-check. (Some other ways were significantly
> faster than just using an exception, but a hard-coded pre-check was
> still the fastest by a long way.)
>
> > Post John's link if you would, I'd love the read up on it
>
> Do a groups.google.com search for subject "Checking if a string" and
> author skeet@pobox.com. It should find just one thread.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too
-
Re: Design question for the WebService Experts...
Will, I was talking in terms of features, not code. I.e. having one service
handling both flight lookups and bookings as oposed to having one looking up
flights and one booking them.
Jerry
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:OL50qF6LEHA.1484@tk2msftngp13.phx.gbl...
> Alvin:
>
> Is that across the board (if for instance no exceptions are caught)? I'm
> just wondering b/c exceptions aren't cheap, and it makes sense that an
> evaluation would be a lot cheaper than an exception, but assuming that
there
> is no exception, does that still hold? Post John's link if you would, I'd
> love the read up on it
> "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> news:O$29AshLEHA.1272@tk2msftngp13.phx.gbl...
> > Not necessarily. less can be subset of more and still not be faster. It
> > doesn't depend on the subset, it depends on the code being executed with
> > respect to the optimizations being performed. Consider
> >
> > int i = 0;
> > while(true)
> > {
> > try
> > {
> > i = Double.Parse(val);
> > }
> > catch
> > {
> > }
> > }
> >
> > executes about 50 times slower than
> > int i = 0;
> > while(true)
> > {
> > try
> > {
> > if(val is a number)
> > i = Double.Parse(val);
> > }
> > catch
> > {
> > }
> > }
> >
> > *that example was adapted from jon skeet performance testing.
> >
> > --
> > Regards,
> > Alvin Bruney
> > [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> > Got tidbits? Get it here... http://tinyurl.com/27cok
> > "Jerry Pisk" <jerryiii@hotmail.com> wrote in message
> > news:e$44P9gLEHA.808@tk2msftngp13.phx.gbl...
> > > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> > > news:u7lrJ5eLEHA.2068@TK2MSFTNGP11.phx.gbl...
> > >> >less code equals faster execution
> > >>
> > >> this is not an absolute for obvious reasons.
> > >
> > > Absolutely but if the "less" code is a subset of "more" code then it's
> > > pretty safe to say that it is going to be faster.
> > >
> > > Jerry
> > >
> > >> --
> > >> Regards,
> > >> Alvin Bruney
> > >> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> > >> Got tidbits? Get it here... http://tinyurl.com/27cok
> > >> "Mark" <mark@--somewhere--.com> wrote in message
> > >> news:Xns94D9AB2425D9Emarksomewherecom@207.46.248.16...
> > >> > "Jerry Pisk" <jerryiii@hotmail.com> wrote in
> > >> > news:e7kD0IPLEHA.2244@tk2msftngp13.phx.gbl:
> > >> >
> > >> >> 2. Once you start adding servers, it's faster to run two smaller,
> > >> >> faster (less code equals faster execution) services each on its
own
> > >> >> server than running a single huge service on both servers. It's
like
> > >> >> running IIS on one box and running SQL on another as opposed to
> > >> >> running both on two boxes. Specialization is faster.
> > >> >
> > >> > That's not necessarily true... Depending on what you're doing,
> running
> > > IIS
> > >> > and SQL both on the same machine can be a LOT faster (especially
with
> > >> > multiple processors or large amounts of data transferred).
> > >> >
> > >> > The truth is, as long as all your webservices are going to run on
the
> > > same
> > >> > machine, you'll get the same performance whether you put them in
one
> or
> > >> > split them into multiple. There will be no noticeable performance
> > >> > difference, especially when you factor in all the internet
> > >> > latency/http/SOAP encoding going on.
> > >> >
> > >> > Mark
> > >>
> > >>
> > >
> > >
> >
> >
>
>
-
Re: Design question for the WebService Experts...
Understood. I think the dichotomy up there was kind of mangled, both points
were correct, just arguing different issues.
"Jerry Pisk" <jerryiii@hotmail.com> wrote in message
news:O7NIZQFMEHA.140@TK2MSFTNGP09.phx.gbl...
> Will, I was talking in terms of features, not code. I.e. having one
service
> handling both flight lookups and bookings as oposed to having one looking
up
> flights and one booking them.
>
> Jerry
>
> "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> news:OL50qF6LEHA.1484@tk2msftngp13.phx.gbl...
> > Alvin:
> >
> > Is that across the board (if for instance no exceptions are caught)?
I'm
> > just wondering b/c exceptions aren't cheap, and it makes sense that an
> > evaluation would be a lot cheaper than an exception, but assuming that
> there
> > is no exception, does that still hold? Post John's link if you would,
I'd
> > love the read up on it
> > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> > news:O$29AshLEHA.1272@tk2msftngp13.phx.gbl...
> > > Not necessarily. less can be subset of more and still not be faster.
It
> > > doesn't depend on the subset, it depends on the code being executed
with
> > > respect to the optimizations being performed. Consider
> > >
> > > int i = 0;
> > > while(true)
> > > {
> > > try
> > > {
> > > i = Double.Parse(val);
> > > }
> > > catch
> > > {
> > > }
> > > }
> > >
> > > executes about 50 times slower than
> > > int i = 0;
> > > while(true)
> > > {
> > > try
> > > {
> > > if(val is a number)
> > > i = Double.Parse(val);
> > > }
> > > catch
> > > {
> > > }
> > > }
> > >
> > > *that example was adapted from jon skeet performance testing.
> > >
> > > --
> > > Regards,
> > > Alvin Bruney
> > > [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> > > Got tidbits? Get it here... http://tinyurl.com/27cok
> > > "Jerry Pisk" <jerryiii@hotmail.com> wrote in message
> > > news:e$44P9gLEHA.808@tk2msftngp13.phx.gbl...
> > > > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in
message
> > > > news:u7lrJ5eLEHA.2068@TK2MSFTNGP11.phx.gbl...
> > > >> >less code equals faster execution
> > > >>
> > > >> this is not an absolute for obvious reasons.
> > > >
> > > > Absolutely but if the "less" code is a subset of "more" code then
it's
> > > > pretty safe to say that it is going to be faster.
> > > >
> > > > Jerry
> > > >
> > > >> --
> > > >> Regards,
> > > >> Alvin Bruney
> > > >> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> > > >> Got tidbits? Get it here... http://tinyurl.com/27cok
> > > >> "Mark" <mark@--somewhere--.com> wrote in message
> > > >> news:Xns94D9AB2425D9Emarksomewherecom@207.46.248.16...
> > > >> > "Jerry Pisk" <jerryiii@hotmail.com> wrote in
> > > >> > news:e7kD0IPLEHA.2244@tk2msftngp13.phx.gbl:
> > > >> >
> > > >> >> 2. Once you start adding servers, it's faster to run two
smaller,
> > > >> >> faster (less code equals faster execution) services each on its
> own
> > > >> >> server than running a single huge service on both servers. It's
> like
> > > >> >> running IIS on one box and running SQL on another as opposed to
> > > >> >> running both on two boxes. Specialization is faster.
> > > >> >
> > > >> > That's not necessarily true... Depending on what you're doing,
> > running
> > > > IIS
> > > >> > and SQL both on the same machine can be a LOT faster (especially
> with
> > > >> > multiple processors or large amounts of data transferred).
> > > >> >
> > > >> > The truth is, as long as all your webservices are going to run on
> the
> > > > same
> > > >> > machine, you'll get the same performance whether you put them in
> one
> > or
> > > >> > split them into multiple. There will be no noticeable performance
> > > >> > difference, especially when you factor in all the internet
> > > >> > latency/http/SOAP encoding going on.
> > > >> >
> > > >> > Mark
> > > >>
> > > >>
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Similar Threads
-
By Application Development in forum Perl
Replies: 8
Last Post: 11-07-2007, 10:44 AM
-
By Application Development in forum Adobe Tools
Replies: 12
Last Post: 09-28-2006, 02:41 PM
-
By Application Development in forum DOTNET
Replies: 1
Last Post: 01-23-2006, 07:30 PM
-
By Application Development in forum Java
Replies: 0
Last Post: 06-02-2004, 09:19 PM
-
By Application Development in forum basic.visual
Replies: 1
Last Post: 01-25-2004, 05:17 AM