mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 14:11:34 +03:00
c7ddd679fd
### Benchmark `yarn workspace @affine/server-native bench` ``` ┌─────────┬────────────┬─────────┬────────────────────┬──────────┬─────────┐ │ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │ ├─────────┼────────────┼─────────┼────────────────────┼──────────┼─────────┤ │ 0 │ 'tiktoken' │ '5' │ 176932518.76000002 │ '±4.71%' │ 100 │ │ 1 │ 'native' │ '16' │ 61041597.51000003 │ '±0.60%' │ 100 │ └─────────┴────────────┴─────────┴────────────────────┴──────────┴─────────┘ ```
14 lines
518 B
JavaScript
14 lines
518 B
JavaScript
import { createRequire } from 'node:module';
|
|
|
|
const require = createRequire(import.meta.url);
|
|
|
|
/** @type {import('.')} */
|
|
const binding = require('./server-native.node');
|
|
|
|
export const mergeUpdatesInApplyWay = binding.mergeUpdatesInApplyWay;
|
|
export const verifyChallengeResponse = binding.verifyChallengeResponse;
|
|
export const mintChallengeResponse = binding.mintChallengeResponse;
|
|
export const getMime = binding.getMime;
|
|
export const Tokenizer = binding.Tokenizer;
|
|
export const fromModelName = binding.fromModelName;
|