Skip to content

Instantly share code, notes, and snippets.

View lahma's full-sized avatar

Marko Lahma lahma

View GitHub Profile
@lahma
lahma / ProjectionParameters.cs
Last active October 15, 2017 13:17
Projection with filtering
using System;
using System.Collections.Generic;
using System.Linq;
using Raven.Client.Documents.Linq;
using Xunit;
namespace FastTests.Client.Queries
{
public class ProjectionParameters : RavenTestBase
{
@lahma
lahma / Raven4Filtering.cs
Last active October 23, 2017 16:50
More wishes what filtering would allow
using System.Collections.Generic;
using System.Linq;
using Raven.Client.Documents.Linq;
using Raven.Client.Documents.Session;
using Xunit;
namespace FastTests.Client.Queries
{
public class ProjectionParameters : RavenTestBase
{
RavenDB 3.5.4 / Windows Service
LoadFullDatasets 47.535 s NA 1319500.0000 242000.0000 4000.0000 7631.44 MB
LoadDocumentsCollection 29.600 s NA 576000.0000 133000.0000 3000.0000 3457.87 MB
LoadDocumentsCollectionFiltered 4.608 s NA 7000.0000 2000.0000 43.42 MB
StoreResults 8.578 s NA 257500.0000 60500.0000 3500.0000 1028.7 MB
RavenDB 4.0 - RC2 / Dockerized Linux
LoadFullDatasets 11.38 s NA 1097500.0000 114000.0000 6022.7 MB
@lahma
lahma / Jint_v3.0.0-beta-1088.md
Last active January 10, 2018 20:43
Results using https://github.com/rushfrisby/jsnetperf/pull/2 with different Jint versions
BenchmarkDotNet=v0.10.11, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.192)
Processor=Intel Core i7-6820HQ CPU 2.70GHz (Skylake), ProcessorCount=8
Frequency=2648437 Hz, Resolution=377.5812 ns, Timer=TSC
  [Host]     : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2600.0
  Job-ZRUPTL : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2600.0

InvocationCount=4  LaunchCount=1  TargetCount=3  
UnrollFactor=4 WarmupCount=3 
@lahma
lahma / Jint_v2.9.1.md
Last active January 10, 2018 20:44
Results using https://github.com/rushfrisby/jsnetperf/pull/2 with different Jint versions
BenchmarkDotNet=v0.10.11, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.125)
Processor=Intel Core i7-6820HQ CPU 2.70GHz (Skylake), ProcessorCount=8
Frequency=2648436 Hz, Resolution=377.5813 ns, Timer=TSC
  [Host]     : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2600.0
  Job-ZRUPTL : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2600.0

InvocationCount=4  LaunchCount=1  TargetCount=3  
UnrollFactor=4 WarmupCount=3 
@lahma
lahma / BenchmarkDotNetCsvsToDiff.cs
Created January 10, 2018 21:16
Quick and dirty program to calcualte result differences from two directories and show percentages
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
namespace ConsoleApp1
{
class Program
{
@lahma
lahma / MruPropertyCacheBenchmark.cs
Last active January 16, 2018 16:15
Dictionary performance comparison
public class MruPropertyCacheBenchmark
{
string[] stringArray;
private Dictionary<string, IPropertyDescriptor> _basicDictionary;
private Dictionary<string, IPropertyDescriptor> _ordinalDictionary;
private MruPropertyCache2<IPropertyDescriptor> _mruPropertyCache;
private StringMap<IPropertyDescriptor> _stringMap;
private MruPropertyCache<IPropertyDescriptor> _mruPropertyCacheLinked;
Method FileName Mean Error StdDev Median Gen 0 Gen 1 Gen 2 Allocated
Run dromaeo-3d-cube 114.54 ms 0.2585 ms 0.3869 ms 114.39 ms 1375.0000 250.0000 - 7318.63 KB
Run dromaeo-core-eval 27.01 ms 0.0214 ms 0.0314 ms 27.03 ms 62.5000 - - 299.8 KB
Run dromaeo-object-array 277.62 ms 0.8433 ms 1.2622 ms 277.48 ms 39500.0000 2000.0000 1000.0000 166027.98 KB
Run dromaeo-object-regexp 1,161.51 ms 3.9209 ms 5.8687 ms 1,161.56 ms 57500.0000 34437.5000 21687.5000 **43482
#!/bin/bash
# based on https://raw.githubusercontent.com/kvaes/docker-rancher-scripts/master/agent-with-local-ip/rancher.sh
# Variable Check
echo "# Checking Variables"
if [ -z "$1" ];
then
echo "!!! no hosturl was supplied"
exit 2
#!/bin/bash
# $1 = Azure storage account name
# $2 = Azure storage account key
# $3 = Azure file share name
# $4 = mountpoint path
# For more details refer to https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/
# update package lists
apt-get -y update