Giter VIP home page Giter VIP logo

Comments (6)

rynowak avatar rynowak commented on July 20, 2024

Rough instructions (powershell-based):

First checkout the precompilation branch

#Do this before you publish
$env:MvcRazorCompileOnPublish="true"

# We need to work around https://github.com/aspnet/MvcPrecompilation/issues/123
# print this do you can remember it's value
$env:DOTNET_SHARED_STORE 

$env:DOTNET_SHARED_STORE=""

# Do the publish
dotnet publish -c Release -f netcoreapp2.0 --manifest $env:JITBENCH_ASPNET_MANIFEST

# Set this back to its original value
$env:DOTNET_SHARED_STORE="C:\Users\rynowak\git\aspnet\JitBench\.store" 

# Now run it
cd bin\Release\netcoreapp2.0\publish
dotnet .\MusicStore.dll

With View Compilation

image

> dotnet .\MusicStore.dll
Server started in 606ms

Starting request to http://localhost:5000
warn: Microsoft.EntityFrameworkCore.Query[100102]
      Query: '(from Genre g in DbSet<Genre> select [g].Name).Take(__p_0)' uses a row limiting operation (Skip/Take) with
out OrderBy which may lead to unpredictable results.
Response: OK
Request took 628ms

Cold start time (server start + first request time): 1234ms


Running 100 requests
Steadystate min response time: 2ms
Steadystate max response time: 8ms
Steadystate average response time: 2ms

ASP.NET loaded from store

Baseline

image

> dotnet .\MusicStore.dll
Server started in 576ms

Starting request to http://localhost:5000
warn: Microsoft.EntityFrameworkCore.Query[100102]
      Query: '(from Genre g in DbSet<Genre> select [g].Name).Take(__p_0)' uses a row limiting operation (Skip/Take) with
out OrderBy which may lead to unpredictable results.
Response: OK
Request took 2301ms

Cold start time (server start + first request time): 2877ms


Running 100 requests
Steadystate min response time: 2ms
Steadystate max response time: 8ms
Steadystate average response time: 2ms

ASP.NET loaded from store

from jitbench.

rynowak avatar rynowak commented on July 20, 2024

/cc @noahfalk @JosephTremoulet @lt72 @russellhadley @DamianEdwards @davidfowl (and others I'm probably forgetting)

This is the performance impact of taking Roslyn off of the startup path. This will be the default experience for deployed/published apps. Runtime compilation is still the default for local development.

Yeah, you saw that right. It takes less than half as long to start up when the views are compiled on publish. That cuts 1673ms off of the first request. Server start and steady-state timings are virtually identical.

Interestingly enough the %age of CPU time as JIT time as reported by perfview is consistently between 35%-40%. This has been the case in every ASP.NET scenario we have measure (big and small, precompiled views, runtime compiled views and no views at all).

I still think that the runtime compilation scenario is the best one to track as the main scenario because:

  1. It's the most expensive
  2. It's a superset of precompiled views

Ideally we could also automate this as a secondary metric.


Github won't let me upload the perfview traces here, it says they are too big. Shoot me a mail if you want them (or use those instructions and have fun making your own).

from jitbench.

lt72 avatar lt72 commented on July 20, 2024

+1 for adding pre-compiled views as secondary metric.

from jitbench.

noahfalk avatar noahfalk commented on July 20, 2024

Thats a great result Ryan! For the secondary metric I'm happy to let you guys (ASP.Net) set priority, assuming you care about it and its cheap/easy to collect then I agree it would be good to have.

The 35-40% jit number is interesting, but I'm guessing what you are seeing is that Jit is running in a relatively fixed proportion to class loading and assembly loading while managed code execution time and dotnet startup time are fairly small players. It makes sense that jit <-> class loading is closely coupled, but deliberate scenario choices should be able to shift the balance between (jit + class loading) and assembly loading. For example with enough NGEN'ed images (jit+class loading) should drop near 0. Of course none of your scenarios do that by design.

from jitbench.

rynowak avatar rynowak commented on July 20, 2024

9bef199

from jitbench.

rynowak avatar rynowak commented on July 20, 2024

Added instructions to the readme and added the necessary dependencies

from jitbench.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.