perfview
Copilot instructions4.8k starsChanged 6 months agoMITView on GitHub
PerfView is a Windows performance-analysis tool for investigating CPU and memory issues, built on the TraceEvent library for parsing ETW and EventPipe trace data. The solution (PerfView.sln) contains the WPF GUI application, the cross-platform TraceEvent library, and several supporting libraries. Follow existing patterns — when in doubt, match the surrounding code.
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about microsoft/perfview
- dotnet/runtime“Stabilize performance measurement”GitHub · Oct 9, 2020 · 16 reactions
- dotnet/BenchmarkDotNet“NativeMemoryDiagnoser”GitHub · Apr 12, 2019 · 13 reactions
- dotnet/diagnostics“[dotnet trace] Add Chromium Trace Event file format to list of supported formats”GitHub · Mar 10, 2020 · 5 reactions
- dotnet/diagnostics“Document the EventPipeFormat in this repository”GitHub · Feb 5, 2020 · 5 reactions
- fsprojects/Paket“reduce memory allocations in Requirements.simplify”GitHub · Jan 16, 2026 · 3 reactions
The biggest 5 of 13 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 13
Talked about on GitHub and Hacker News (13 times).
On GitHub · 12
- Oct 9, 2020Stabilize performance measurement — dotnet/runtime16 reactions · 24 comments
- Apr 12, 2019NativeMemoryDiagnoser — dotnet/BenchmarkDotNet13 reactions · 17 comments
- Mar 10, 2020[dotnet trace] Add Chromium Trace Event file format to list of supported formats — dotnet/diagnostics5 reactions · 14 comments
- Feb 5, 2020Document the EventPipeFormat in this repository — dotnet/diagnostics5 reactions
- Jan 16, 2026reduce memory allocations in Requirements.simplify — fsprojects/Paket3 reactions · 1 comment
7 more on GitHub
- Jun 29, 2020[Proposal] Introduce a new tool for converting traces — dotnet/diagnostics3 reactions · 5 comments
- Mar 17, 2020On Stack Replacement Next Steps — dotnet/runtime3 reactions · 59 comments
- Sep 28, 2026chore(deps): update dependency microsoft.diagnostics.tracing.traceevent to 3.2.8 — thomhurst/Dekaf2 reactions · 3 comments
- Jul 26, 2021Change MonoProfiler provider GUID to be based on algorithm used by TraceEvent library. — dotnet/runtime2 reactions · 2 comments
- Dec 3, 2020Improve Eventing Fundamentals — dotnet/runtime2 reactions · 2 comments
- Nov 16, 2020Support for Windows ARM64 — bleroy/core-imaging-playground2 reactions · 7 comments
- Feb 12, 2020Fix LoggingEventSource to handle null strings — dotnet/extensions2 reactions · 7 comments
On Hacker News · 1
- Sep 20, 2016PerfView- a perf-analysis tool that helps isolate CPU/memory/slow perf issues1 point · 1 comment
The file
We split this copilot-instructions.md into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Follow existing patterns — when in doubt, match the surrounding code.
- Very specific: line 46
All private members go after all public members, wrapped in #region private so Visual Studio outlining (Ctrl-M Ctrl-O) collapses them.
- Distinctive: line 53
Use inline comments to explain non-obvious logic and design decisions.
- Very specific: line 56
Use Debug.Assert() liberally to validate internal invariants — this is why tests must run in Debug configuration.
- Very specific: line 66
Keep changes minimal and focused — complexity is the enemy (see CONTRIBUTING.md).
- Distinctive: line 67
Prefer simplicity over cleverness.
- Distinctive: line 68
Run tests in Debug configuration before submitting changes.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions for PerfView
Project Overview
PerfView is a Windows performance-analysis tool for investigating CPU and memory issues, built on the TraceEvent library for parsing ETW and EventPipe trace data. The solution (PerfView.sln) contains the WPF GUI application, the cross-platform TraceEvent library, and several supporting libraries.
Architecture
src/PerfView/— WPF GUI application (Windows-only, .NET Framework 4.7.2+, C# 7.3 features only)src/TraceEvent/— Core trace parsing library (cross-platform, targets netstandard2.0)src/FastSerialization/— Lightweight binary serialization librarysrc/MemoryGraph/— Memory dump analysis (graph-based heap representation)src/Utilities/— Shared utility codesrc/HeapDump*/— Heap dump capture using ClrMD (Windows-only native interop)src/EtwClrProfiler/— Native C++ CLR profiler emitting ETW events (Windows-only)src/PerfViewExtensions/— Extensibility mechanism ("Global" project)
Build & Test
- Full solution (Windows):
build.cmdor openPerfView.slnin Visual Studio 2026 with the repository.vsconfigcomponents installed. Native ETWClrProfiler projects use the latest installed MSVC v145 toolset. - Individual projects (cross-platform via dotnet CLI):
dotnet build src/TraceEvent/TraceEvent.csproj -c Debugdotnet build src/FastSerialization/FastSerialization.csproj -c Debugdotnet build src/MemoryGraph/MemoryGraph.csproj -c Debug
- Running tests:
dotnet test <TestProject>.csproj -c Debug— always use Debug configuration so assertions are active.src/TraceEvent/TraceEvent.Tests/TraceEvent.Tests.csprojsrc/FastSerialization.Tests/FastSerialization.Tests.csprojsrc/LinuxTracing.Tests/LinuxTracing.Tests.csprojsrc/PerfView.Tests/PerfView.Tests.csproj(Windows-only)src/SymbolsAuth.Tests/SymbolsAuth.Tests.csproj
- Tests use xUnit. The full test suite should complete in under 1 minute.
- NuGet uses central package management (
src/Directory.Packages.props). Use the repo-localNuget.configwhen restoring:dotnet restore --configfile Nuget.config.
C# Coding Conventions
Follow existing patterns — when in doubt, match the surrounding code.
Naming
- Standard .NET conventions:
PascalCasefor types, methods, and properties;camelCasefor parameters and locals. - Private instance fields: prefix with
m_(e.g.,m_nodeCount). The_prefix is also acceptable. - Static fields: prefix with
s_(e.g.,s_defaultSize). - No Hungarian notation.
Class Layout
- Order members for readability as a public contract: constructors/factories first, then properties, then methods.
- All private members go after all public members, wrapped in
#region privateso Visual Studio outlining (Ctrl-M Ctrl-O) collapses them. - Fields go together at the end of the private region — this makes it easy to see all object state at a glance.
Comments & Documentation
- This codebase is heavily commented — maintain that standard.
- Public types and public members exposed outside their assembly must have XML doc comments (
/// <summary>). Parameter-level docs are optional if names are descriptive. - Private fields often need comments, especially to document invariants they maintain.
- Use inline comments to explain non-obvious logic and design decisions.
Error Handling & Assertions
- Use
Debug.Assert()liberally to validate internal invariants — this is why tests must run in Debug configuration. - Throw specific exceptions with descriptive messages for public API misuse.
Other Patterns
- Type aliases for semantic clarity:
using Address = System.UInt64; - Lazy initialization for expensive sub-objects (check for null, create on first access).
- Reuse event objects in TraceEvent callbacks to minimize GC pressure.
Making Changes
- Keep changes minimal and focused — complexity is the enemy (see
CONTRIBUTING.md). - Prefer simplicity over cleverness. Performance optimizations that add complexity need measurements to justify them.
- Run tests in Debug configuration before submitting changes.
- PerfView embeds its support DLLs into the EXE at build time, creating non-obvious build dependencies. If you see "DLL not found" errors, a normal (non-clean) rebuild usually fixes it.
- The
Globalproject depends on PerfView — expect unresolved references there until PerfView builds first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

