-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add benchcat: cat + throughput measurements (#15564)
benchcat, "bc" for short, is a tool that I've written over the last two years to help me benchmark OpenConsole and Windows Terminal. Initially it only measured the time it took to print a file as fast as possible, but it's grown to support a number of arguments, including chunk (`WriteFile` call) sizes, repeat counts and VT mode with italic and colorized output. In the future I also wish to add a way to generate the output data on the fly via command line arguments. One unusual trait of benchcat is that it is compiled entirely without CRT and vcruntime. I did this so that I could test it on Windows XP. Also, it's kind of funny seeing how it's only about 11kB. This commit also fixes a couple `$LASTEXITCODE` cases, because our spellchecker was bothering me a lot with this PR and so I just fixed it.
- Loading branch information
Showing
9 changed files
with
787 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>16.0</VCProjectVersion> | ||
<Keyword>Win32Proj</Keyword> | ||
<ProjectGuid>{2C836962-9543-4CE5-B834-D28E1F124B66}</ProjectGuid> | ||
<ProjectName>benchcat</ProjectName> | ||
<RootNamespace>benchcat</RootNamespace> | ||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | ||
<TargetName>bc</TargetName> | ||
</PropertyGroup> | ||
<Import Project="$(SolutionDir)\src\common.build.pre.props" /> | ||
<ItemDefinitionGroup> | ||
<ClCompile> | ||
<PrecompiledHeader>NotUsing</PrecompiledHeader> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Console</SubSystem> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> | ||
<GenerateManifest>false</GenerateManifest> | ||
<WholeProgramOptimization>false</WholeProgramOptimization> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> | ||
<ClCompile> | ||
<BufferSecurityCheck>false</BufferSecurityCheck> | ||
<ControlFlowGuard>false</ControlFlowGuard> | ||
<ExceptionHandling>false</ExceptionHandling> | ||
<PreprocessorDefinitions>NODEFAULTLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<SDLCheck>false</SDLCheck> | ||
</ClCompile> | ||
<Link> | ||
<EntryPointSymbol>main</EntryPointSymbol> | ||
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClCompile Include="main.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="crt.cpp" /> | ||
</ItemGroup> | ||
<Import Project="$(SolutionDir)\src\common.build.post.props" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
#ifdef NODEFAULTLIB | ||
|
||
#include <intrin.h> | ||
|
||
#pragma function(memcpy) | ||
void* memcpy(void* dst, const void* src, size_t size) | ||
{ | ||
__movsb(static_cast<BYTE*>(dst), static_cast<const BYTE*>(src), size); | ||
return dst; | ||
} | ||
|
||
#pragma function(memset) | ||
void* memset(void* dst, int val, size_t size) | ||
{ | ||
__stosb(static_cast<BYTE*>(dst), static_cast<BYTE>(val), size); | ||
return dst; | ||
} | ||
|
||
#endif |
Oops, something went wrong.