Skip to content

Instantly share code, notes, and snippets.

View mratsim's full-sized avatar
:shipit:

Mamy Ratsimbazafy mratsim

:shipit:
  • Paris
View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 2 columns, instead of 1. in line 5.
EC ScalarMul 255-bit G1 (vartime reference DoubleAdd) ; ECP_ShortW_Jac[Fp[BLS12_381], G1] ; 10939.722 ops/s; 91410 ns/op; 301080 CPU cycles (approx)
EC ScalarMul 255-bit G1 (vartime wNAF-3) ; ECP_ShortW_Jac[Fp[BLS12_381], G1] ; 13986.601 ops/s; 71497 ns/op; 235493 CPU cycles (approx)
EC ScalarMul 255-bit G1 (vartime wNAF-4) ; ECP_ShortW_Jac[Fp[BLS12_381], G1] ; 14373.599 ops/s; 69572 ns/op; 229152 CPU cycles (approx)
EC ScalarMul 255-bit G1 (vartime wNAF-5) ; ECP_ShortW_Jac[Fp[BLS12_381], G1] ; 14523.484 ops/s; 68854 ns/op; 226787 CPU cycles (approx)
EC ScalarMul 255-bit G1 (vartime endomorphism + wNAF-3) ; ECP_ShortW_Jac[Fp[BLS12_381], G1] ; 21272.975 ops/s; 47008 ns/op; 154834 CPU cycles (approx)
EC ScalarMul 255-bit G1 (vartime endomorphism + wNAF-4) ; ECP_ShortW_Jac
@mratsim
mratsim / Eventcounts.md
Last active November 19, 2023 13:52
Eventcounts

Eventcounts are "lock-free condition variables".

The lock acquisition is removed from the hot path, significantly reducing contention and overhead.

Eventcounts were pioneered by Chris Thomasson and Dmitry Vyukov (from Go multithreading runtime, LLVM thread sanitizer, Relacy Race Detector and Eigen/Tensorflow multithreading runtime).

Production

@mratsim
mratsim / android-backup-apk-and-datas.md
Created September 23, 2023 21:25 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

@mratsim
mratsim / R Makevars
Created March 20, 2017 17:37
~/.R/Makevars to compile R package with OpenMP and all compiler optimizations
# ~/.R/Makevars
PKG_LIBS = -fopenmp -lgomp
PKG_CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS=-D_FORTIFY_SOURCE=2
CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
CXXFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
@mratsim
mratsim / trusted_setups.md
Last active May 16, 2023 21:30
A data serialization format for trusted setups for zero-knowledge cryptography
@mratsim
mratsim / macro_assembler_x86.nim
Created April 21, 2023 14:55
Compile-Time x86 ASM Assembler
# Constantine
# Copyright (c) 2018-2019 Status Research & Development GmbH
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at http://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 std/[macros, strutils, sets, hashes, algorithm]
@mratsim
mratsim / nvidia-top
Last active February 7, 2023 09:41
NVIDIA GPU monitoring
1. nvidia-smi -q -g 0 -d TEMPERATURE,POWER,CLOCK,MEMORY -l #Flags can be UTILIZATION, PERFORMANCE (on Tesla) ...
2. nvidia-smi dmon
3. nvidia-smi -l 1
Docs: http://developer.download.nvidia.com/compute/cuda/6_0/rel/gdk/nvidia-smi.331.38.pdf
Python-bindings: https://pypi.python.org/pypi/nvidia-ml-py/
1. Loop:
==============NVSMI LOG==============