Skip to content

Instantly share code, notes, and snippets.

@wemeetagain
wemeetagain / bigint_vs_bn_vs_number.js
Last active February 8, 2023 05:22
BigInt vs BN.js vs number benchmark
const Benchmark = require('benchmark')
const BN = require('bn.js')
const suite = new Benchmark.Suite
// native numbers
let num_a, num_b
// BN.js numbers
let bn_a, bn_b
// native BigInt numbers
const Benchmark = require('benchmark')
const ssz = require('../ssz-js/src')
const {serialize, deserialize, hashTreeRoot} = require('../ssz-ts/lib')
const suite = new Benchmark.Suite
const SubObj = {
fields: [
['x', 'uint8'],
['y', 'uint16'],
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required