Skip to content

Instantly share code, notes, and snippets.

@andykuszyk
andykuszyk / Performance profiling NUnit tests using Visual Studio 2015.md
Last active February 14, 2018 17:13
Performance Profiling NUnit tests using Visual Studio 2015

Performance Profiling NUnit using Visual Studio 2015

Shortly after learning about the great performance profiling tools built into Visual Studio 2015 (we've just upgraded from 2010, when the best free solution was to use SlimTune [which is awesome for a free, unsupported, open-source tool, but not as awesome as the tools in VS 2015]), I wanted to be able to performance profile slow running unit tests.

Previously, using the afore mentioned SlimTune (https://code.google.com/archive/p/slimtune/), I would run the NUnit gui runner and run the test I was interested in. Although this is still an option using the new VS tools, it doesn't give you a very accurate picture of what's taking the time and, importantly, results in the "hot path" analysis not being useful.

As such, I followed these simple steps to profile my first few tests.

1. Prepare the test for profiling

Nothing special here, I just marked the test for profiling with a unique category so I could pull it out and run it independently from the com

@brine
brine / gist:6428912
Last active December 22, 2015 06:09
mechanical shuffles
def riffleShuffle(group, x = 0, y = 0):
mute()
deck = []
for c in group:
deck.append(c) ##loads the deck contents into a list
topChunk = deck[:len(deck)/2] ##Grabs the top half of the deck
bottomChunk = deck[len(deck)/2:] ##Grabs the bottom half of the deck
deck = [] #This'll be the new deck stack
while len(bottomChunk) > 0: ##keep looping as long as there's still cards
deck.insert(0, bottomChunk.pop()) ##The bottom of the chunk gets added to the top of the deck
@brine
brine / gist:5861740
Created June 25, 2013 19:46
bunch of quick stuff to fix
918 player summary tab hard to read
113 hide marker count when n = 1
021 right-click menu accessible in pile view windows
??? figure out why shuffling takes so freakin long after viewing the pile
631 allow players to add more packs to a sealed pool
??? allow players to choose different sealed packs than other players
114 rapidly clicking on counters or manipulating markers suffers from lag
143 allow game def to assign card/group functions to cards you dont control
159 manually edit number of markers on a card via clicking the number
919 sealed editor - hide sets that dont have sealed packs
@jamietre
jamietre / MethodInfoExtensions
Last active January 7, 2023 06:20
GetSignature extension for PropertyInfo and MethodInfo: returns the detailed method/property signature by reflection
public static class MethodInfoExtensions
{
/// <summary>
/// Return the method signature as a string.
/// </summary>
///
/// <param name="property">
/// The property to act on.
/// </param>
///
@barryokane
barryokane / sso_login_freshdesk.cs
Created May 17, 2012 11:08
SSO Login for Freshdesk support portal - ASP.Net C# Sample Code
protected void Page_Load(object sender, EventArgs e)
{
string url = GetSsoUrl(ConfigurationManager.AppSettings["FreshDesk.BaseUrl"], //including trailing slash
ConfigurationManager.AppSettings["FreshDesk.Secert"], user.UserName, user.Email);
Response.Redirect(url);
}
string GetSsoUrl(string baseUrl, string secert, string name, string email)
{
return String.Format("{0}login/sso/?name={1}&email={2}&hash={3}", baseUrl, Server.UrlEncode(name),