Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is codebehind faster than inline code?

Tags:

c#

asp.net

According to the question: Is C# code faster than Visual Basic.NET code? Was said that C# and VB.NET generates the same CLR code at the end.

But in the case when I'm using codebehind and inline code, are there different performance (ignoring the language used)?

like image 287
Zanoni Avatar asked Aug 03 '09 18:08

Zanoni


1 Answers

Inline code can require compilation the first time the request is made. After that (or if it's precompiled), there's absolutely zero difference between them.

By the way, even if it requires compilation, the speed difference should be insignificant as ASP.NET will have to compile a source file anyway. The difference will come down to a adding a few lines of code in a large source file!

like image 101
mmx Avatar answered Nov 09 '22 17:11

mmx