AFFiNE/packages/backend/native/Cargo.toml
Brooooooklyn c7ddd679fd
feat(server): use native tokenizer impl (#6960)
### 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     │
└─────────┴────────────┴─────────┴────────────────────┴──────────┴─────────┘
```
2024-05-16 07:55:10 +00:00

33 lines
770 B
TOML

[package]
name = "affine_server_native"
version = "1.0.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
[dependencies]
chrono = "0.4"
file-format = { version = "0.25", features = ["reader"] }
napi = { version = "2", default-features = false, features = [
"napi6",
"async",
] }
napi-derive = { version = "2", features = ["type-def"] }
rand = "0.8"
sha3 = "0.10"
tiktoken-rs = "0.5.9"
y-octo = { git = "https://github.com/y-crdt/y-octo.git", branch = "main" }
[target.'cfg(not(target_os = "linux"))'.dependencies]
mimalloc = { workspace = true }
[target.'cfg(all(target_os = "linux", not(target_arch = "arm")))'.dependencies]
mimalloc = { workspace = true, features = ["local_dynamic_tls"] }
[dev-dependencies]
tokio = "1"
[build-dependencies]
napi-build = "2"