iceshrimp-legacy/packages/backend
s1idewhist1e c58ce6c53b Refactor: use rust for native mastodon id conversion (#9786)
This uses [napi-rs](https://napi.rs/) to allow for automatic generation of node bindings for the native code.

I also changed the `isolatedModules` TS flag to false to allow for `static enum` to be shared across modules. It doesn't seem to be necessary for the build system that CK uses.

Currently this method does not work with ID generators with longer IDs. Likely the best solution is to add another key in the database.

Some benchmarks for 1 million conversions:

```
	node, x1_000_000: 2.847s
	rust, x1_000_000: 1.265s
```

There are still optimizations that can be made, but I think this is a good starting point and a good way to bring rust into the CK stack.

Co-authored-by: s1idewhist1e <trombonedude05@gmail.com>
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9786
Co-authored-by: s1idewhist1e <s1idewhist1e@noreply.codeberg.org>
Co-committed-by: s1idewhist1e <s1idewhist1e@noreply.codeberg.org>
2023-03-31 01:58:28 +00:00
..
.idea Create move type 2022-11-23 21:49:52 +01:00
.vscode Update settings.json 2022-04-15 21:33:00 +09:00
assets docs: 📝 custom assets 2023-02-11 13:16:45 -08:00
migration fix: repo url 2023-03-19 16:53:49 -07:00
native-utils Refactor: use rust for native mastodon id conversion (#9786) 2023-03-31 01:58:28 +00:00
nsfw-model feat: auto nsfw detection (#8840) 2022-07-07 21:06:37 +09:00
src Refactor: use rust for native mastodon id conversion (#9786) 2023-03-31 01:58:28 +00:00
test Remove usused eslint files 2023-01-12 22:27:17 -08:00
.mocharc.json fix: mocha テストが動かないのを修正 v2 (#8892) 2022-06-26 19:16:32 +09:00
.swcrc perf: 👷 build backend with swc 2023-01-10 16:48:49 -08:00
check_connect.js Check redis connection 2023-02-23 22:04:47 -08:00
jsconfig.json use eslint 2021-11-12 10:35:41 +09:00
ormconfig.js refactor: migrate to typeorm 3.0 (#8443) 2022-03-26 15:34:00 +09:00
package.json Refactor: use rust for native mastodon id conversion (#9786) 2023-03-31 01:58:28 +00:00
tsconfig.json Refactor: use rust for native mastodon id conversion (#9786) 2023-03-31 01:58:28 +00:00