What's the point of precompiling a web site?

  • Thread starter Thread starter Alan Silver
  • Start date Start date
A

Alan Silver

Hello,

I was just looking at aspnet_compiler.exe and thinking how useful it was
to have your web site compiled, then I thought that maybe it isn't!!

What's the advantage? I would never upload a site, nor even upload a new
version of one file, without immediately testing it a browser. Thus, any
first-time compilation delay will be seen by me.

Did I miss something? TIA
 
I was just looking at aspnet_compiler.exe and thinking how useful it was
to have your web site compiled, then I thought that maybe it isn't!!

What's the advantage? I would never upload a site, nor even upload a new
version of one file, without immediately testing it a browser. Thus, any
first-time compilation delay will be seen by me.

Did I miss something? TIA

rumor says this first time compilation did not look good during public
presentations.

Wiktor Zychla
 
"Wiktor Zychla [C# said:
I was just looking at aspnet_compiler.exe and thinking how useful it
was to have your web site compiled, then I thought that maybe it isn't!!

What's the advantage? I would never upload a site, nor even upload a
new version of one file, without immediately testing it a browser.
Thus, any first-time compilation delay will be seen by me.

Did I miss something? TIA

rumor says this first time compilation did not look good during public
presentations.

Ah, another management-driven decision eh? It looked about that useful!!
 
re:
What's the advantage? I would never upload a site, nor even upload a new version of one file,
without immediately testing it a browser. Thus, any first-time compilation delay will be seen by
me.

Did I miss something? TIA

Of course, if you're running a site with 4,000 pages, it might take you a while
to call each page so it gets compiled so there's no appreciable delay the first
time any page is called by any client.

Might that be what you missed ?




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
news:[email protected]...
 
Juan T. Llibre said:
re:

Of course, if you're running a site with 4,000 pages, it might take you a while
to call each page so it gets compiled so there's no appreciable delay the first
time any page is called by any client.

Might that be what you missed ?

Could be, but then how often do you change that many pages in one go? A
site that big would probably be run from some sort of dynamic source,
no?

The other point is that the first-time hit isn't *that* significant, and
it only happens once, so even if a user were to experience it, they
probably wouldn't notice.

Comments? Thanks
 
I have similar doings but afaik IIS still compiles (from MSIL to PE..)
I can't tell if a pre-compiled situation is more speedy on the first hit?
So i wonder if it really helps.
I'm using it for distribution, i don't want to spread plain code.

Bad situation of pre-compiled is that you can't easily replace a single aspx
or so.
 
Edwin Knoppert said:
I have similar doings but afaik IIS still compiles (from MSIL to PE..)
I can't tell if a pre-compiled situation is more speedy on the first hit?
So i wonder if it really helps.
I'm using it for distribution, i don't want to spread plain code.

Why not? Anyone can decompile your compiled code, so what do you gain?
Bad situation of pre-compiled is that you can't easily replace a single aspx
or so.

Yup, that was one of the disadvantages that made me wonder if it was
worth it.
 
Thus wrote Alan,
Hello,

I was just looking at aspnet_compiler.exe and thinking how useful it
was to have your web site compiled, then I thought that maybe it
isn't!!

What's the advantage? I would never upload a site, nor even upload a
new version of one file, without immediately testing it a browser.
Thus, any first-time compilation delay will be seen by me.

Did I miss something? TIA

I've also thought of pre-compilation as an overrated feature for exactly
that reason: You don't simply deploy a web app without doing a proper shakedown
test. Even if not, who really cares about the early bird user who has two
wait a second or two when hitting a page for the first time?

The remaining practical use case is assuring that all pages actually do compile
-- something that depending on how your pages are composed (think of dynamically
created server controls) could be rather hard to verify during testing.

Cheers,
 
1) You can prevent decompilation, not a discussion for now though.

2) The question from me was if a 4000+ page was faster if compiled on the
first hit then ordinary aspx pages.
I'm not sure, but i can't test that since i don't have such a situation.
 
Hello,

I was just looking at aspnet_compiler.exe and thinking how useful it was
to have your web site compiled, then I thought that maybe it isn't!!

What's the advantage? I would never upload a site, nor even upload a new
version of one file, without immediately testing it a browser. Thus, any
first-time compilation delay will be seen by me.

Did I miss something? TIA


Alan et al,

There are a couple advantages I can think of.

1) I can use the aspnet_compiler on a build engine to make sure there
are no errors in any of the .aspx files. If you do any sort of
continuous integration [1] in your CM process then you can let
developers know quickly if they checked in an ASPX file that the
runtime can't parse. I was never really happy that ASPX files could
escape the build process and make it to test before a simple syntax
error was caught.

2) I can pre-compile a non-updateble site and ensure that noone can
"tweak" an page in test or production. I could also deploy a site
without source any .aspx or .ascx files! (some caveats apply).

3) When combined with aspnet_merge I can reduce the number of
assemblies in a web app. A small performance benefit.

All that being said, using aspnet_compiler for performance reasons is
overrated. Getting a web application off the ground is a lot of work!
There is an appdomain to create, assemblies to resolve and load, the
cache is empty, the connection pool is empty, the JITter has to JIT,
etc. etc. The perf benefits of removing the parse/code-generation are
there, but can be dissapointing for someone who thinks it will be a
huge gain.

[1] http://www.martinfowler.com/articles/continuousIntegration.html
 
Alan et al,

There are a couple advantages I can think of.

1) I can use the aspnet_compiler on a build engine to make sure there
are no errors in any of the .aspx files. If you do any sort of
continuous integration [1] in your CM process then you can let
developers know quickly if they checked in an ASPX file that the
runtime can't parse. I was never really happy that ASPX files could
escape the build process and make it to test before a simple syntax
error was caught.

OK, I guess this is a good point for many people, but for me (lone
developer, no CM system), it's not so important.
2) I can pre-compile a non-updateble site and ensure that noone can
"tweak" an page in test or production.

Ditto previous comment ;-)
I could also deploy a site
without source any .aspx or .ascx files! (some caveats apply).

A benefit if you obfuscate, not otherwise - despite popular
(mis)conception.
3) When combined with aspnet_merge I can reduce the number of
assemblies in a web app. A small performance benefit.

OK, so all in all, I can happily ignore precompilation as it has little
advantage for me. I am in sole control of my server, so I don't have
much worry about people looking at my code. If they can get as far as
the code, they can probably just go straight into SQL Server, bypassing
my code. At that stage, I have more to worry about than my code!!

Thanks for the info.
All that being said, using aspnet_compiler for performance reasons is
overrated. Getting a web application off the ground is a lot of work!
There is an appdomain to create, assemblies to resolve and load, the
cache is empty, the connection pool is empty, the JITter has to JIT,
etc. etc. The perf benefits of removing the parse/code-generation are
there, but can be dissapointing for someone who thinks it will be a
huge gain.

[1] http://www.martinfowler.com/articles/continuousIntegration.html
 

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

Back
Top