CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of performance
XML
<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
by Aria Radmand   July 12, 2011 @ 5:12am
127 Views
no comments
 
C#
const string PC_CATEGORY = "_Tmp";
const string PC_NAME = "_Tmp";
 
if (!PerformanceCounterCategory.Exists(PC_CATEGORY))
{
    CounterCreationDataCollection data = new CounterCreationDataCollection();
    CounterCreationData counter = new CounterCreationData(PC_NAME, "", PerformanceCounterType.NumberOfItems32);
    var pcCategory = PerformanceCounterCategory.Create(PC_CATEGORY, "", PerformanceCounterCategoryType.MultiInstance, data);
 
    data.Add(counter);
by bnaya   February 09, 2011 @ 12:45am
177 Views
no comments
 
C#
public class PerformanceTester
{
    public TimeSpan TotalTime { get; private set; }
    public TimeSpan AverageTime { get; private set; }
    public TimeSpan MinTime { get; private set; }
    public TimeSpan MaxTime { get; private set; }
    public Action Action { get; set; }
 
    public PerformanceTester(Action action)
    {
by tarasn   April 12, 2010 @ 12:14pm
244 Views
no comments
 
SQL
declare @x int, @y int, @z int
set @x = 1
set @y = 2
set @z = 1
 
-- returns @x (because not equal)
select case when @x = @y then null else @x end
 
-- returns null (because equal)
select case when @x = @z then null else @x end
by Jerry Nixon   March 05, 2010 @ 9:11am
652 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
 
namespace Nixoncorp.LoopPerformance
{
    class Test
    {
by Jerry Nixon   February 23, 2010 @ 12:54pm
952 Views
no comments
 
Data units of msec resolution = 0.000301 usec
10 typeof(string)                       : count: 10000    0.285 +- 0%    msec
10 typeof(string).TypeHandle            : count: 10000    0.030 +- 3%    msec
10 anObj.GetType() == type              : count: 10000    0.444 +- 6%    msec
10 Type.GetTypeHandle(obj).Equals(tHnd) : count: 10000    0.589 +- 1%    msec
10 anObj.GetType() == typeof(string)    : count: 10000    0.057 +- 2%    msec
10 (anObj is string)                    : count: 10000    0.113 +- 10%   msec
by Athens Springer   October 30, 2009 @ 9:14am
454 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate