mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-02-04 14:00:49 +00:00
nhj
more
This commit is contained in:
13
unified-ai-platform/node_modules/fastq/LICENSE
generated
vendored
Normal file
13
unified-ai-platform/node_modules/fastq/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2015-2020, Matteo Collina <matteo.collina@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
66
unified-ai-platform/node_modules/fastq/bench.js
generated
vendored
Normal file
66
unified-ai-platform/node_modules/fastq/bench.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
'use strict'
|
||||
|
||||
const max = 1000000
|
||||
const fastqueue = require('./')(worker, 1)
|
||||
const { promisify } = require('util')
|
||||
const immediate = promisify(setImmediate)
|
||||
const qPromise = require('./').promise(immediate, 1)
|
||||
const async = require('async')
|
||||
const neo = require('neo-async')
|
||||
const asyncqueue = async.queue(worker, 1)
|
||||
const neoqueue = neo.queue(worker, 1)
|
||||
|
||||
function bench (func, done) {
|
||||
const key = max + '*' + func.name
|
||||
let count = -1
|
||||
|
||||
console.time(key)
|
||||
end()
|
||||
|
||||
function end () {
|
||||
if (++count < max) {
|
||||
func(end)
|
||||
} else {
|
||||
console.timeEnd(key)
|
||||
if (done) {
|
||||
done()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function benchFastQ (done) {
|
||||
fastqueue.push(42, done)
|
||||
}
|
||||
|
||||
function benchAsyncQueue (done) {
|
||||
asyncqueue.push(42, done)
|
||||
}
|
||||
|
||||
function benchNeoQueue (done) {
|
||||
neoqueue.push(42, done)
|
||||
}
|
||||
|
||||
function worker (arg, cb) {
|
||||
setImmediate(cb)
|
||||
}
|
||||
|
||||
function benchSetImmediate (cb) {
|
||||
worker(42, cb)
|
||||
}
|
||||
|
||||
function benchFastQPromise (done) {
|
||||
qPromise.push(42).then(function () { done() }, done)
|
||||
}
|
||||
|
||||
function runBench (done) {
|
||||
async.eachSeries([
|
||||
benchSetImmediate,
|
||||
benchFastQ,
|
||||
benchNeoQueue,
|
||||
benchAsyncQueue,
|
||||
benchFastQPromise
|
||||
], bench, done)
|
||||
}
|
||||
|
||||
runBench(runBench)
|
||||
14
unified-ai-platform/node_modules/fastq/example.js
generated
vendored
Normal file
14
unified-ai-platform/node_modules/fastq/example.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict'
|
||||
|
||||
/* eslint-disable no-var */
|
||||
|
||||
var queue = require('./')(worker, 1)
|
||||
|
||||
queue.push(42, function (err, result) {
|
||||
if (err) { throw err }
|
||||
console.log('the result is', result)
|
||||
})
|
||||
|
||||
function worker (arg, cb) {
|
||||
cb(null, 42 * 2)
|
||||
}
|
||||
0
unified-ai-platform/node_modules/fastq/test/promise.js
generated
vendored
Normal file
0
unified-ai-platform/node_modules/fastq/test/promise.js
generated
vendored
Normal file
Reference in New Issue
Block a user