Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
ed0b7140
Commit
ed0b7140
authored
Sep 12, 2010
by
ArnoldZokas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build performance optimisations
parent
eb1af682
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
27 deletions
+52
-27
Common.targets
cfg/Common.targets
+5
-5
benchmark.ps1
cfg/benchmark.ps1
+23
-0
build.csproj
cfg/build.csproj
+24
-22
No files found.
cfg/Common.targets
View file @
ed0b7140
...
...
@@ -8,7 +8,7 @@
<Target
Name=
"_Compile"
>
<MSBuild
Projects=
"%(Solution.Identity)"
Properties=
"Configuration=%(Solution.Configuration);Platform=%(Solution.Platform)"
Targets=
"%(Solution.BuildTarget)"
BuildInParallel=
"true"
Condition=
"%(Solution.CompileGroup) ==
$(CompileGroup)"
ToolsVersion=
"4.0
"
/>
Targets=
"%(Solution.BuildTarget)"
BuildInParallel=
"true"
Condition=
"%(Solution.CompileGroup) ==
'Build'
"
/>
</Target>
<Target
Name=
"_EnsureEnvironment"
>
...
...
@@ -16,7 +16,7 @@
<Error
Text=
"Tool "Protogen" could not be found at path $(ProtogenExePath)"
Condition=
"!Exists($(ProtogenExePath))"
/>
</Target>
<Target
Name=
"_GenerateSource"
DependsOnTargets=
"_Clean;_Compile;_
Compile
"
>
<Target
Name=
"_GenerateSource"
DependsOnTargets=
"_Clean;_Compile;_
EnsureEnvironment
"
>
<PropertyGroup>
<ProtosList>
@(Protos)
</ProtosList>
<Args>
$(ProtosList.Replace(`;`,` `))
</Args>
...
...
@@ -35,8 +35,8 @@
Targets=
"%(Solution.BuildTarget)"
BuildInParallel=
"true"
Condition=
"%(Solution.CompileGroup) == $(CompileGroup)"
/>
</Target>
<Target
Name=
"_Test"
DependsOnTargets=
"_CompileGeneratedSource"
>
<Exec
Command=
""$(NUnitExePath)" %(NUnitTests.Identity) /xml=%(NUnitTests.Filename)%(NUnitTests.Extension).
xml
"
WorkingDirectory=
"$(BuildTempDirectory)"
/>
<Target
Name=
"_Test"
DependsOnTargets=
"_CompileGeneratedSource"
>
<Exec
Command=
""$(NUnitExePath)" %(NUnitTests.Identity) /xml=%(NUnitTests.Filename)%(NUnitTests.Extension).
txt
"
WorkingDirectory=
"$(BuildTempDirectory)"
/>
</Target>
<Target
Name=
"_Package"
DependsOnTargets=
"_CopyGeneratedSource"
>
...
...
@@ -46,7 +46,7 @@
<!--
BENCHMARK - this needs optimising
-->
<Target
Name=
"_GenerateBenchmarkSource"
>
<Target
Name=
"_GenerateBenchmarkSource"
DependsOnTargets=
"_Clean"
>
<PropertyGroup>
<Args>
$(BenchmarkProtosDirectory)\google_size.proto $(BenchmarkProtosDirectory)\google_speed.proto
</Args>
</PropertyGroup>
...
...
cfg/benchmark.ps1
0 → 100644
View file @
ed0b7140
write-host
`n
Running build. Please wait...
$iterations
=
10
for
(
$i
=
1;
$i
-le
$iterations
;
$i
++
)
{
$sw
=
[
System.Diagnostics.StopWatch]::StartNew
()
#& $env:windir\Microsoft.NET\Framework\v4.0.30319\msbuild.exe build.csproj /m /nologo /v:q
&
$env
:windir\Microsoft.NET\Framework\v4.0.30319\msbuild.exe build.csproj /m /nologo /v:q /t:BuildAll /p:CompileGroup
=
BuildAll
$sw
.Stop
()
$msbuildTotalRunTime
+
=
$sw
.ElapsedMilliseconds
$sw
=
[
System.Diagnostics.StopWatch]::StartNew
()
#& "..\nant-0.91-alpha2\bin\NAnt.exe" -buildfile:"..\ProtocolBuffers.build" -nologo -q clean-build
&
"..\nant-0.91-alpha2\bin\NAnt.exe"
-buildfile:
"..\ProtocolBuffers.build"
-nologo -q clean-build-all
$sw
.Stop
()
$nantTotalRunTime
+
=
$sw
.ElapsedMilliseconds
}
write-host
`n
MSBuild average speed over
$iterations
iterations:
(
$msbuildTotalRunTime
/
$iterations
)
milliseconds
write-host
NAnt average speed over
$iterations
iterations:
(
$nantTotalRunTime
/
$iterations
)
milliseconds
`n
write-host
MSBuild execution speed:
([
Math]::Round
(
$(
100/
$nantTotalRunTime
*
$msbuildTotalRunTime
)
, 2
))
%
"(as a percentage of NAnt execution speed)"
`n
\ No newline at end of file
cfg/build.csproj
View file @
ed0b7140
...
...
@@ -4,8 +4,7 @@
<PropertyGroup>
<ProjectName>
Protocol Buffers
</ProjectName>
<BuildConfiguration>
Debug
</BuildConfiguration>
<CompileGroup>
Build
</CompileGroup>
<VSHostExcludeWildcard>
$(SourceDirectory)\**\*.vshost.exe*
</VSHostExcludeWildcard>
<CompileGroup>
BuildAll
</CompileGroup>
<!--Directory Paths-->
<ProjectDirectory>
$(MSBuildProjectDirectory)\..
</ProjectDirectory>
...
...
@@ -50,7 +49,7 @@
<Platform>
Any CPU
</Platform>
<BuildTarget>
Build
</BuildTarget>
<CompileGroup>
BuildAll
</CompileGroup>
</Solution>
</Solution>
<Solution
Include=
"$(SolutionFile)"
>
<Configuration>
Silverlight2
</Configuration>
<Platform>
Any CPU
</Platform>
...
...
@@ -63,7 +62,7 @@
<BuildTarget>Build</BuildTarget>
<CompileGroup>BuildAll</CompileGroup>
</Solution>-->
<Protos
Include=
"$(ProtosDirectory)\google\protobuf\descriptor.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\google\protobuf\csharp_options.proto"
/>
<Protos
Include=
"$(ProtosDirectory)\google\protobuf\unittest.proto"
/>
...
...
@@ -105,7 +104,7 @@
<GeneratedSource
Include=
"$(BuildTempDirectory)\UnitTestImportProtoFile.cs"
>
<TargetDirectory>
$(SourceDirectory)\ProtocolBuffers.Test\TestProtos
</TargetDirectory>
</GeneratedSource>
<NUnitTests
Include=
"$(SourceDirectory)\ProtocolBuffers.Test\bin\$(BuildConfiguration)\Google.ProtocolBuffers.Test.dll"
/>
<NUnitTests
Include=
"$(SourceDirectory)\Protogen.Test\bin\$(BuildConfiguration)\Google.ProtocolBuffers.ProtoGen.Test.dll"
/>
...
...
@@ -114,47 +113,50 @@
<PackageContents
Include=
"$(ProjectDirectory)\protos\**\*.*"
>
<TargetDirectory>
\protos
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtocolBuffers\bin\Debug\Google.ProtocolBuffers.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtocolBuffers\bin\Debug\Google.ProtocolBuffers.*"
>
<TargetDirectory>
\Debug
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoGen\bin\Debug\ProtoGen.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoGen\bin\Debug\ProtoGen.*"
>
<TargetDirectory>
\Debug
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoMunge\bin\Debug\ProtoMunge.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoMunge\bin\Debug\ProtoMunge.*"
>
<TargetDirectory>
\Debug
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoDump\bin\Debug\ProtoDump.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoDump\bin\Debug\ProtoDump.*"
>
<TargetDirectory>
\Debug
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoBench\bin\Debug\ProtoBench.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoBench\bin\Debug\ProtoBench.*"
>
<TargetDirectory>
\Debug
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtocolBuffers\bin\Release\Google.ProtocolBuffers.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtocolBuffers\bin\Release\Google.ProtocolBuffers.*"
>
<TargetDirectory>
\Release
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoGen\bin\Release\ProtoGen.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoGen\bin\Release\ProtoGen.*"
>
<TargetDirectory>
\Release
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoMunge\bin\Release\ProtoMunge.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoMunge\bin\Release\ProtoMunge.*"
>
<TargetDirectory>
\Release
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoDump\bin\Release\ProtoDump.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoDump\bin\Release\ProtoDump.*"
>
<TargetDirectory>
\Release
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtoBench\bin\Release\ProtoBench.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtoBench\bin\Release\ProtoBench.*"
>
<TargetDirectory>
\Release
</TargetDirectory>
</PackageContents>
<PackageContents
Include=
"$(SourceDirectory)\ProtocolBuffers\bin\Silverlight2\Google.ProtocolBuffers.*"
Exclude=
"$(VSHostExcludeWildcard)"
>
<PackageContents
Include=
"$(SourceDirectory)\ProtocolBuffers\bin\Silverlight2\Google.ProtocolBuffers.*"
>
<TargetDirectory>
\Silverlight2
</TargetDirectory>
</PackageContents>
<!--<PackageContents Include="$(SourceDirectory)\ProtocolBuffers\bin\ReleaseCF\Google.ProtocolBuffers.*" Exclude="$(VSHostExcludeWildcard)">
<TargetDirectory>\CompactFramework35</TargetDirectory>
</PackageContents>-->
<!--<PackageContents Include="$(SourceDirectory)\ProtocolBuffers\bin\ReleaseCF\Google.ProtocolBuffers.*">
<TargetDirectory>\CompactFramework35</TargetDirectory>
</PackageContents>-->
<PackageContents
Include=
"$(LibDirectory)\Protoc*"
>
<TargetDirectory>
\Protoc
</TargetDirectory>
</PackageContents>
</ItemGroup>
<!--target groups-->
<Target
Name=
"Build"
DependsOnTargets=
"_Clean;_Compile;_EnsureEnvironment;_GenerateSource;_CopyGeneratedSource;_CompileGeneratedSource;_Test
"
/>
<Target
Name=
"BuildAll"
DependsOnTargets=
"_Clean;_Compile;_EnsureEnvironment;
_GenerateSource;_CopyGeneratedSource;_CompileGeneratedSource;_Test;_Package"
/>
<Target
Name=
"Benchmark"
DependsOnTargets=
"_
Clean;_
GenerateBenchmarkSource;_CompileBenchmarkAssembly;_PrepareBenchmarkEnvironment;_RunBenchmark"
/>
<Target
Name=
"Build"
DependsOnTargets=
"_GenerateSource;_CopyGeneratedSource;_CompileGeneratedSource;_Test;_Package
"
/>
<Target
Name=
"BuildAll"
DependsOnTargets=
"
_GenerateSource;_CopyGeneratedSource;_CompileGeneratedSource;_Test;_Package"
/>
<Target
Name=
"Benchmark"
DependsOnTargets=
"_GenerateBenchmarkSource;_CompileBenchmarkAssembly;_PrepareBenchmarkEnvironment;_RunBenchmark"
/>
</Project>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment