h2load
를 사용해 리버스 프록시 서버로서의 H2O와 Nginx를 벤치마크 및 비교해 보았다. HTTP/2와 HTTP/3 각각에 대해 테스트하였고, 벤치마크 명령어를 다섯 번 실행하여 시간이 가장 적게 소모된 경우를 뽑았다.
2022년 1월 8일 기준 최신 커밋을 빌드하였으며, ECDH Curves 관련 PR을 적용했다.
auto m=partition(A.begin(), A.end(), [&](pii p) { return p<pii{}; }); | |
sort(A.begin(), m, [&](pii a, pii b) { return cross(a, b)<0; }); | |
sort(m, A.end(), [&](pii a, pii b) { return cross(a, b)<0; }); |
#define private public | |
#include <bitset> | |
#undef private | |
#include <bits/stdc++.h> | |
#include <x86intrin.h> | |
using namespace std; | |
template<size_t _Nw> void _M_do_sub(_Base_bitset<_Nw> &A, const _Base_bitset<_Nw> &B) { | |
for(int i=0, c=0; i<_Nw; i++) |
const replaceSetMap = (object) => { | |
if (object) { | |
if (object.constructor === Set) return [...object]; | |
if (object.constructor === Map) return Object.fromEntries(object); | |
} | |
return object; | |
}; | |
const decycle = (rootObject, { replacer = replaceSetMap, seen = new WeakMap() } = {}) => { | |
const _decycle = (object, path = "$") => { |
const replaceSetMap = (object) => { | |
if (object) { | |
if (object.constructor === Set) return [...object]; | |
if (object.constructor === Map) return Object.fromEntries(object); | |
} | |
return object; | |
}; | |
const firstScan = ($, needle, { replacer = replaceSetMap, seen = new WeakMap() } = {}) => { | |
const found = []; |
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
using ull = unsigned long long; | |
struct point { | |
int x, y; | |
point operator-(point v) const { return { x - v.x, y - v.y }; } | |
ll operator~() const { return ll(x) * x + ll(y) * y; } | |
}; |
// #define DONT_USE_SIMD | |
// #pragma GCC optimize("O3") | |
#pragma GCC target("avx2") | |
#include <iostream> | |
#include <x86intrin.h> | |
#define INDEX_BIT_SIZE 14 | |
using i16 = short; | |
using i32 = int; | |
using u32 = unsigned int; |
const concurrent = async(limit, fns) => { | |
const result = []; | |
const runningTasks = []; | |
for (const fn of fns) { | |
const promise = fn(); | |
result.push(promise); | |
const emptyIndex = runningTasks.length === limit ? await Promise.race(runningTasks) : runningTasks.length; | |
const currentIndex = emptyIndex; | |
runningTasks[emptyIndex] = promise.then(() => currentIndex); | |
} |
h2load
를 사용해 리버스 프록시 서버로서의 H2O와 Nginx를 벤치마크 및 비교해 보았다. HTTP/2와 HTTP/3 각각에 대해 테스트하였고, 벤치마크 명령어를 다섯 번 실행하여 시간이 가장 적게 소모된 경우를 뽑았다.
2022년 1월 8일 기준 최신 커밋을 빌드하였으며, ECDH Curves 관련 PR을 적용했다.
function<void(shared_ptr<node>&&)> dfs=[&](shared_ptr<node>&& p) { | |
if(p->l) p->push(p->l), dfs(move(p->l)); | |
A[M++]=p->x; | |
if(p->r) p->push(p->r), dfs(move(p->r)); | |
}; | |
function<shared_ptr<node>(int, int)> build=[&](int l, int r) { | |
int m=(l+r)>>1; | |
auto p=node::New(A[m]); | |
if(l<m) p->l=build(l, m-1); |
const fs = require('fs'); | |
const filenum = 30; // or 100 | |
const lines = 2000000; // or 1000000 | |
const errors = 100000; | |
const ratio = lines / errors | 0; | |
const count = lines / ratio | 0; | |
for (let i = 1; i <= filenum; i += 1) { |