Any performance hit when using inline code?

Discussion in 'ASP .Net' started by Showjumper, Jan 30, 2004.

  1. Showjumper

    Showjumper Guest

    Is there a peformance hit when using inline code? As an example, lets i
    store a user's preferences for backgtound color of a page. When he/she logs
    in, i stick the color value into their session and then pull it out on the
    next page and populate the bgcolor of the body directly in the html. Does
    this approach have any loss in performance as compared to adding
    runat=server to the body tag and accessing it from code behind? If there is
    a loss in performance, can it add up with a number of users?
     
    Showjumper, Jan 30, 2004
    #1
    1. Advertising

  2. Showjumper

    Scott Allen Guest

    You don't pay a performance penalty for inline code since the runtime
    will compile it.

    --
    Scott
    http://www.OdeToCode.com

    On Thu, 29 Jan 2004 19:01:23 -0600, "Showjumper"
    <> wrote:

    >Is there a peformance hit when using inline code? As an example, lets i
    >store a user's preferences for backgtound color of a page. When he/she logs
    >in, i stick the color value into their session and then pull it out on the
    >next page and populate the bgcolor of the body directly in the html. Does
    >this approach have any loss in performance as compared to adding
    >runat=server to the body tag and accessing it from code behind? If there is
    >a loss in performance, can it add up with a number of users?
    >
     
    Scott Allen, Jan 30, 2004
    #2
    1. Advertising

  3. There may be a slight performance differenc ewith regards to the initial
    compilation if you don't use a DLL for the CodeBehind. However, as Pages are
    cached after compilation, the difference would be minimal.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Showjumper" <> wrote in message
    news:#...
    > Is there a peformance hit when using inline code? As an example, lets i
    > store a user's preferences for backgtound color of a page. When he/she

    logs
    > in, i stick the color value into their session and then pull it out on the
    > next page and populate the bgcolor of the body directly in the html. Does
    > this approach have any loss in performance as compared to adding
    > runat=server to the body tag and accessing it from code behind? If there

    is
    > a loss in performance, can it add up with a number of users?
    >
    >
     
    Kevin Spencer, Jan 30, 2004
    #3
    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. Jasper
    Replies:
    1
    Views:
    452
    Joe Smith
    Jun 27, 2004
  2. zzfreddybb
    Replies:
    4
    Views:
    423
    Dennis Handly
    Jan 12, 2005
  3. CK
    Replies:
    9
    Views:
    400
    Jerry Rasmussen
    Oct 19, 2006
  4. Replies:
    1
    Views:
    340
    Alvin Bruney [MVP]
    Aug 8, 2007
  5. rvj
    Replies:
    1
    Views:
    106
    Anthony Jones
    Aug 10, 2008
Loading...

Share This Page