aspnet / JitBench

Repo for testing JIT stuff
Other
15 stars 24 forks source link

AllRready using git submodule #86

Closed adamsitnik closed 6 years ago

adamsitnik commented 6 years ago

This PR introduces a new app to our benchmarking suite: AllReady.

About AllReady

"allReady is an open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities. http://www.htbox.org/projects/allready"

Why AllReady?

It's a real-world web app which uses some of the most popular libraries like MediatR, Autofac, Hangfire, EntityFrameworkCore, Newtonsoft.Json and WindowsAzure.Storage. It should help us to be closer to what our end customers use in their production systems.

Our goal is to have a real-world web application scenario to optimize and test the performance for real workloads.

Benchmark

The benchmark does exactly the same job the MusicStore benchmark does. I have even refactored the code and now it's shared between these two apps.

How can I include the razor views (.cshtml) files from a different folder (not a subfolder of the asp.net app)? I know that it is crucial for the JIT scenarios to get the /p:MvcRazorCompileOnPublish=true working.

@rynowak could you help me with that? I tried to search for some asp.net core .target files but failed to find the right thing. Currently, I get an empty AllReady.PrecompiledViews.dll when publishing and following error when running with dotnet run;

/cc @jorive

rynowak commented 6 years ago

@pranavkm - can you help find a workaround for using linked files with old precompilation?

It would be OK to manually hack something in the project files

pranavkm commented 6 years ago

Is it ok to copy the files to the project directory (rather than linking them)? Unfortunately all the path generation is baked inside the tool, so it's hard to hack around it.

adamsitnik commented 6 years ago

@rynowak @pranavkm thanks for help, I used something like this to copy the razor views from the submodule to the app folder before build:

  <ItemGroup>
    <RazorViewsFiles Include="..\..\submodules\AllReady\AllReadyApp\Web-App\AllReady\**\*.cshtml" />
  </ItemGroup>

  <Target Name="CopyFiles" BeforeTargets="PreBuildEvent">
    <Copy SourceFiles="@(RazorViewsFiles)" DestinationFiles="@(RazorViewsFiles->'$(MSBuildThisFileDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
  </Target>
pranavkm commented 6 years ago

That looks like a viable solution @adamsitnik

adamsitnik commented 6 years ago

@jorive This PR is ready

jorive commented 6 years ago

LGTM

jorive commented 6 years ago

Out of curiosity, what netcoreapp can the AllReady project target?

adamsitnik commented 6 years ago

@jorive 2.0 is the default, but anything can be set by using the JITBENCH_TARGET_FRAMEWORK_MONIKER env var

<TargetFramework>$(JITBENCH_TARGET_FRAMEWORK_MONIKER)</TargetFramework>
<TargetFramework Condition="'$(TargetFramework)'==''">netcoreapp2.0</TargetFramework>
rynowak commented 6 years ago

This looks great! @adamsitnik and @jorive is there anything left to do here from your point of view or is this all ready (pun intended)?

I just spoke with our OSS-licensing-understander-of-rules-and-enforcer-of-policies @Eilon and we need to do a few bookkeeping things - which won't take much time

adamsitnik commented 6 years ago

@rynowak it's ready. Should I do the mentioned bookkeeping?

adamsitnik commented 6 years ago

@rynowak @pranavkm could you please merge the PR? It's 100% ready

Eilon commented 6 years ago

@adamsitnik I have to do my little homework first; getting started on it right now. It's required prior to merging.

Eilon commented 6 years ago

@rynowak : I filed the OSS request, and here's what we need to do regarding notices:

After merging this PR, add a new file to the root of this repo called ThirdPartyNotices.txt with exactly the following text:

.NET Core uses third-party libraries or other resources that may be
distributed under licenses different than the .NET Core software.

In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:

           dotnet@microsoft.com

The attached notices are provided for information only.

License notice for allReady
------------------------------------

"MIT License

Copyright (c) 2017 Humanitarian Toolbox

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE."
rynowak commented 6 years ago

Thanks @Eilon - I added the file to this branch and to the master branch (which still shows up as the default).