Skip to content

Instantly share code, notes, and snippets.

View batiati's full-sized avatar

Rafael Batiati batiati

View GitHub Profile
@batiati
batiati / Benchmark.cs
Created November 15, 2023 14:26
TigerBeetle client batching benchmark
using System;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
namespace TigerBeetle.Benchmarks
{
public static partial class BenchmarkBatching
@batiati
batiati / sample.c
Created December 23, 2022 20:24
TigerBeetle C sample
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <sys/time.h>
#include "tb_client.h"
/////////////////////////////////////////////////////////////////////////////////////
// Place this file at the same folder tb_client.h //
// Shows the basic usage of the TigerBeetle C client. //
package com.tigerbeetle;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
@batiati
batiati / main.go
Last active October 31, 2022 11:32
TigerBeetle async maxConcurrency
package main
import (
"fmt"
"log"
tb "github.com/tigerbeetledb/tigerbeetle-go"
"github.com/tigerbeetledb/tigerbeetle-go/pkg/types"
tb_types "github.com/tigerbeetledb/tigerbeetle-go/pkg/types"
)
@batiati
batiati / BenchDecode.java
Created October 14, 2022 12:52
Bitcast demo
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.concurrent.TimeUnit;
public class BenchDecode {
static final int TRANSFER = 128;
@batiati
batiati / Bench.md
Last active September 1, 2022 16:33
Simple benchmark of tb_client implementations

Simple benchmark of tb_client implementations

  • Tigerbeetle client and server compiled with -Drelease-safe
  • Using a single, local Tigerbeetle replica, formated before each execution.
  • Create 2 accounts.
  • Create N batches of transfers with 8191 transactions per batch (full message lenght), measuring the time.
  • Prints the total time, P100 time per batch, and transactions per second ratio.

1. Zig benchmark

@batiati
batiati / mustache_bench.mjs
Created August 1, 2022 23:19
Simple benchmark for mustache templates
import { run, bench } from "mitata";
import Mustache from "mustache";
var template = "<title>{{title}}</title><h1>{{ title }}</h1><div>{{{body}}}</div>";
Mustache.parse(template);
var data = {
title: "Hello, Mustache!",
body: "This is a really simple test of the rendering!",
};