- Download the PerfView tool (for free) from https://github.com/Microsoft/perfview/blob/master/documentation/Downloading.md
- Once you have it open, you can see "Collect" in the menu bar at the top. Click on "Collect" and then "Run". Note this may re-launch PerfView in an elevated process, in which case you may need repeat this step in the elevated window.
- The "Collecting ETW Data while running a command" dialog will pop up. In the Command section, put in the full path for Visual Studio. It'll look like this: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" Don't forget to add in the quotation marks!
- Change the Current Dir field to a directory where the ETL trace files should be created.
- Below the "Current Dir" section, you can see "Thread Time." Please make sure it's checked.
- Ensure the "Zip" checkbox is checked.
- Expand "Advanced Options". Ensure the "No V3.X NGEN Symbols" checkbox is checked.
- Click "Run Command"
- This will start an instance of Visual Studio.
I hereby claim:
- I am aarnott on github.
- I am aarnott (https://keybase.io/aarnott) on keybase.
- I have a public key whose fingerprint is 1E96 8D82 6520 35A8 73DF E2B2 A9B9 910C DCCD A441
To claim this, I am signing this object:
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
using System; | |
using System.Configuration; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.KeyVault; // Install-Package Microsoft.Azure.KeyVault | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; // Install-Package Microsoft.IdentityModel.Clients.ActiveDirectory | |
namespace KeyVaultSample | |
{ | |
class Program |
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
Task ThrottleParallelWorkAsync(IEnumerable<T> data, Action<T> worker) | |
{ | |
TaskScheduler scheduler = new ConcurrentExclusiveSchedulerPair( | |
TaskScheduler.Default, // schedule work to the ThreadPool | |
Environment.ProcessorCount * 2) // Schedule enough to keep all threads busy, with a queue to quickly replace completed work | |
.ConcurrentScheduler; // We only use the concurrent member of this scheduler "pair". | |
return Task.WhenAll( | |
data.Select(v => Task.Factory.StartNew(() => worker(v), CancellationToken.None, TaskCreationOptions.None, scheduler))); | |
} |
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
Task PerformConcurrentWorkAsync<T>(IEnumerable<T> data, Action<T> worker) | |
{ | |
return Task.WhenAll(data.Select(v => Task.Run(() => worker(v)))); | |
} |
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
void WorkOnCollectionConcurrently(IEnumerable<T> data, Action<T> worker) | |
{ | |
foreach (T item in data) | |
{ | |
Task.Run(() => worker(item)); | |
} | |
} |
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
using System; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("*** WITHOUT throttling ***"); |
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
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace ConsoleApp43 | |
{ | |
static class Program | |
{ | |
static void Main(string[] args) |
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
$PackageId = "Microsoft.VisualStudio.Threading" | |
$wr = Invoke-WebRequest "http://packages.nuget.org/v1/FeedService.svc/Packages?`$filter=substringof(%27$PackageId%27,%20Dependencies)%20eq%20true&`$select=Id,Version,Dependencies" | |
if ($wr.StatusCode -ne 200) { | |
Write-Error $wr.StatusDescription | |
return | |
} | |
$xml = [xml]$wr.content | |
$xml.feed.entry.properties |
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
namespace PCLCrypto | |
{ | |
public class KeyFormatterTests | |
{ | |
/* | |
Modulus: a4d5f49f3298500af851b031d27754fd63b8df7f37508b2bea15794ae706abc4cc790d5c8f4bac7ac46ac770b53830a28e97fd3bd9d2afdd18b8db9266965413 | |
Exponent: 010001 | |
P: e6505d775acbc8077462f0cdbe22a59fc6c75758a9a097211bc4e071c963e415 | |
D: 6b87270cb2f4a9427ebacb35b516235b28b271198bfbfecda6e65b39817bd8907b0e7051b74ddb728f1f29220cef00095d63c224d5a148e14e15a9cb4c6849 | |
Q: b73823d2929601f4f95050e17de1587841cbdc4152444f2352d9f83f54d71987 |