Skip to content

Instantly share code, notes, and snippets.

View jtattermusch's full-sized avatar

Jan Tattermusch jtattermusch

  • Google
  • Mountain View, CA
View GitHub Profile
@jtattermusch
jtattermusch / configure_sshd.sh
Last active January 13, 2024 21:28 — forked from samhocevar/gist:00eec26d9e9988d080ac
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# sshd setup script for gRPC Jenkins windows worker.
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
# This script is a cleaned up and improved version of the procedure initially
# found at https://ghc.haskell.org/trac/ghc/wiki/Building/Windows/SSHD
# based on http://www.smithii.com/node/44
# ensure correct loading of env vars
pushd . >/dev/null
for __dir in \
/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Session\ Manager/Environment \
/proc/registry/HKEY_CURRENT_USER/Environment
do
cd "$__dir"
for __var in *
do
# After adding ForceCommand to sshd_config, this will make sure that
# user's env variables are properly loaded.
source /home/jenkins/win_ssh_uservars.sh
if [ "$SSH_ORIGINAL_COMMAND" ]
then
bash -c "$SSH_ORIGINAL_COMMAND"
fi
bash -
ulimit -c unlimited
echo '/tmp/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
# Attach with GDB
# gdb path/to/the/binary /tmp/core.failing_test.3948
FROM debian:stretch
# based on instructions in https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y build-essential autoconf libtool pkg-config
RUN apt-get update && apt-get install -y git curl
RUN cd /root && git clone https://github.com/grpc/grpc
WORKDIR /root/grpc
@jtattermusch
jtattermusch / gist:ae95aaf770eafcbd29b8bef83a1a9df6
Last active April 15, 2020 09:34
Protobuf benchmarks before and after
BEFORE
BenchmarkDotNet=v0.11.4, OS=debian rodete
Intel Xeon CPU 2.30GHz, 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 2.1.12 (CoreCLR 4.6.27817.01, CoreFX 4.6.27818.01), 64bit RyuJIT
DefaultJob : .NET Core 2.1.12 (CoreCLR 4.6.27817.01, CoreFX 4.6.27818.01), 64bit RyuJIT
BEFORE
| Method | BytesToParse | encodedSize | Mean | Error | StdDev | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
|----------------- |------------- |------------ |----------:|----------:|----------:|------------:|------------:|------------:|--------------------:|
| ParseRawVarint32 | 10080 | 1 | 42.587 us | 0.8495 us | 1.3957 us | - | - | - | 88 B |
| ParseRawVarint64 | 10080 | 1 | 45.554 us | 0.8631 us | 0.8074 us | - | - | - | 88 B |
| ParseRawVarint32 | 10080 | 2 | 28.323 us | 0.1714 us | 0.1431 us | 0.0305 | - | - | 88 B |
| ParseRawVarint64 | 10080 | 2 | 25.848 us | 0.2385 us | 0.2231 us | 0.0305 | - | - | 88 B |
AFTER
BenchmarkDotNet=v0.11.4, OS=macOS Mojave 10.14.6 (18G5033) [Darwin 18.7.0]
Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=3.1.101
[Host] : .NET Core 2.1.15 (CoreCLR 4.6.28325.01, CoreFX 4.6.28327.02), 64bit RyuJIT
DefaultJob : .NET Core 2.1.15 (CoreCLR 4.6.28325.01, CoreFX 4.6.28327.02), 64bit RyuJIT
| Method | BytesToWrite | encodedSize | Mean | Error | StdDev | Median | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
WriteRawPrimitivesBenchmark
======================
BEFORE
BenchmarkDotNet=v0.11.4, OS=debian rodete
Intel Xeon W-2135 CPU 3.70GHz, 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.1.301
[Host] : .NET Core 2.1.16 (CoreCLR 4.6.28516.03, CoreFX 4.6.28516.10), 64bit RyuJIT
DefaultJob : .NET Core 2.1.16 (CoreCLR 4.6.28516.03, CoreFX 4.6.28516.10), 64bit RyuJIT
WriteMessagesBenchmark
======================
BEFORE
BenchmarkDotNet=v0.11.4, OS=debian rodete
Intel Xeon W-2135 CPU 3.70GHz, 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.1.301
[Host] : .NET Core 2.1.16 (CoreCLR 4.6.28516.03, CoreFX 4.6.28516.10), 64bit RyuJIT
DefaultJob : .NET Core 2.1.16 (CoreCLR 4.6.28516.03, CoreFX 4.6.28516.10), 64bit RyuJIT