Skip to content

Instantly share code, notes, and snippets.

View mratsim's full-sized avatar
:shipit:

Mamy Ratsimbazafy mratsim

:shipit:
  • Paris
View GitHub Profile
@mratsim
mratsim / mcl with gmp_mont
Created February 10, 2021 15:31
GMP vs Assembly for ZKP
$ ./bin/bls12_test.exe -m gmp_mont
JIT 1
ctest:module=size
ctest:module=naive
i=0 curve=BLS12_381
G1
G2
GT
G1::mulCT 656.335Kclk
G1::mul 584.777Kclk
@mratsim
mratsim / README.md
Last active January 29, 2021 00:02
Stash constant-time decimal conversion for constantine

Algorithms

Continued fractions

Continued fractions are used to convert

size_in_bits <=> size_in_decimal

for constant-time buffer preallocation when converting to decimal.

import benchy, random, streams
import jsony, jason
import eminim
#import packedjson, packedjson/deserialiser
import json
import serialization
import json_serialization except Json, toJson
type Node = ref object
active: bool
@mratsim
mratsim / cpp.std.coroutines.draft.md
Created December 22, 2020 15:25 — forked from MattPD/cpp.std.coroutines.draft.md
C++ links: Coroutines (WIP draft)
@mratsim
mratsim / multithreading_flavors.md
Last active December 20, 2020 11:31
Draft - Multithreading flavors: Choosing the right scheduler for the right job.
title author excerpt
Multithreading flavors: Choosing the right scheduler for the right job.
Mamy Ratsimbazafy (mratsim)
Demystifying multithreading for IO and multithreading for Compute.

_Disclaimer: This post represent my current understanding as of December 2020 and might not age well.

With the advent of multicores CPU, developers are urge to blast through performance bottlenecks by exploiting more cores. Hence we are attracted to multithreading solutions like light is attracted by a black hole.

func dacPairing[HashLen](
sigsets: ptr UncheckedArray[SignatureSet[HashLen]],
contexts: ptr UncheckedArray[ContextMultiAggregateVerify[DST]],
numBatches: uint32,
batchID: uint32,
subsetStart: uint32,
subsetStopEx: uint32
): bool =
## Distribute pairing computation using a recursive divide-and-conquer (DAC) algorithm

ethereum/eth2.0-pm#193

Nimbus

  • Mainnet launch, documentation

  • Thanks for supporters, in particular those who supported us on Gitcoin over a year ago.

  • Hot fixes yesterday, another scheduled today

  • Release management: mailing lists, hash of releases

  • Software:

# beacon_chain
# Copyright (c) 2018-2020 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
# Standard library
std/[tables, os, options],