Skip to content

Instantly share code, notes, and snippets.

View sebastienros's full-sized avatar

Sébastien Ros sebastienros

View GitHub Profile
using System.Collections.Generic;
public class MyCollection<T> : IEnumerable<T>
{
private readonly List<T> _collection = new List<T>();
public IEnumerator<T> GetEnumerator() => _collection.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
PS C:\code\runtime> ./build.cmd libs -c Release -arch arm64 -os linux
Determining projects to restore...
Tool 'coverlet.console' (version '1.7.2') was restored. Available commands: coverlet
Tool 'dotnet-reportgenerator-globaltool' (version '4.5.8') was restored. Available commands: reportgenerator
Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.21404.1') was restored. Available commands: xharness
Tool 'microsoft.visualstudio.slngen.tool' (version '6.0.1') was restored. Available commands: slngen
Restore was successful.
All projects are up-to-date for restore.
Determining projects to restore...
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
namespace testfs
{
class Program
{
public static void Main(string[] args)
imports:
- https://raw.githubusercontent.com/dotnet/crank/master/src/Microsoft.Crank.Jobs.Bombardier/bombardier.yml
- https://raw.githubusercontent.com/dotnet/crank/master/src/Microsoft.Crank.Jobs.Wrk/wrk.yml
jobs:
sample:
source:
repository: https://github.com/SixLabors/ImageSharp.Web
# branchOrCommit: master
branchOrCommit: crank
Pipeline Pipeline io_uring Non-pipelined Non-pipelined io_uring
CPU 99 50 (-50%) 97 48 (-50%)
RPS 2,592,670 2,878,222 (+11%) 497,429 631,976 (+26%)
Working set 79 81 79 81
Latency (mean) 1.28 0.98 1.07 1.47
Latency (99th) n/a 7.57 14.8 14.67
Description Cores RPS CPU (%) Memory (MB) Avg. Latency (ms) Startup (ms) Build Time (ms) Published Size (KB) First Request (ms) Latency (ms) Errors
citrine-28 0 77,332 4 67 3.34 201 5002 1964 28.77 0.13 0
perf-12 0 111,772 8 64 2.4 280 5002 1964 42.73 0.39 0
perf-12 1 199,688 17 220 1.48 268 3501 1964 54.01 0.4 0
citrine-28 1 142,147 7 218 2.24 192 3501 1964 28.17

Impact of specific cores on JsonPlatform performance. 14 cores, 28 HT. 0-13 are physical ones and 14-27 are siblings. Checked with lscpu -p.

0-13 14-27 EVEN (0, 2, …) ODD (1, 3, …) ALL (0-27)
RequestsPerSecond: 690,297 687,459 518,939 537,805 893,617
Max CPU (%): 49 49 50 50 99
WorkingSet (MB): 288 272 244 262 410
Avg. Latency (ms): 1.45 1.5 1.25 1.4 1.01
First Request (ms): 37.88 38.15 37.81 38.4 0
Latency (ms): 0.09 0.11 0.11 0.12 0
@sebastienros
sebastienros / results - 5.0.0-alpha.1.20103.10 - varying cores.md
Created March 5, 2020 16:11
IOQueue and CPUs impact on AMD - Plaintext Non Pipelined

5.0.0-alpha.1.20103.10 varying cpus

Description RPS CPU (%) Memory (MB) Avg. Latency (ms) Startup (ms) Build Time (ms) Published Size (KB) First Request (ms) Latency (ms) Errors
0 cpus 70,216 2 70 3.63 260 5501 118715 29.2 0.09 0
1 cpus 145,184 4 72 1.94 245 4001 118715 27.38 0.11 0
2 cpus 225,219 6 72 1.63 243 4001 118715 27.43 0.09 0
3 cpus 225,944 8 72 1.85 244 3501 118715 27
using System;
using System.Buffers;
using System.Buffers.Text;
using System.IO.Pipelines;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp23
@sebastienros
sebastienros / Program.cs
Created October 9, 2019 20:11
GraphQL query using Client Credentials flow in Orchard Core
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program