Buckets:
ktongue/docker_container / .cache /opencode /node_modules /@fastify /proxy-addr /benchmark /compiling.js
| /** | |
| * Globals for benchmark.js | |
| */ | |
| global.proxyaddr = require('..') | |
| global.createReq = createReq | |
| /** | |
| * Module dependencies. | |
| */ | |
| const benchmark = require('benchmark') | |
| const benchmarks = require('beautify-benchmark') | |
| const suite = new benchmark.Suite() | |
| suite.add({ | |
| name: 're-compiling', | |
| minSamples: 100, | |
| fn: 'proxyaddr(req, "loopback")', | |
| setup: 'req = createReq("127.0.0.1", "10.0.0.1")' | |
| }) | |
| suite.add({ | |
| name: 'pre-compiling', | |
| minSamples: 100, | |
| fn: 'proxyaddr(req, trust)', | |
| setup: 'req = createReq("127.0.0.1", "10.0.0.1"); trust = proxyaddr.compile("loopback")' | |
| }) | |
| suite.on('cycle', function onCycle (event) { | |
| benchmarks.add(event.target) | |
| }) | |
| suite.on('complete', function onComplete () { | |
| benchmarks.log() | |
| }) | |
| suite.run({ async: false }) | |
| function createReq (socketAddr, forwardedFor) { | |
| return { | |
| socket: { | |
| remoteAddress: socketAddr | |
| }, | |
| headers: { | |
| 'x-forwarded-for': (forwardedFor || '') | |
| } | |
| } | |
| } | |
Xet Storage Details
- Size:
- 963 Bytes
- Xet hash:
- 7947303b25c5005dd21f345f82262a4feee66f838278fa294c3b341e54d6630b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.