This website requires JavaScript.
Explore
Help
Sign In
161sh
/
iceshrimp-161sh
Watch
1
Star
0
Fork
0
You've already forked iceshrimp-161sh
mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced
2024-11-23 12:39:59 +01:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
6844039534
iceshrimp-161sh
/
packages
/
backend
/
native-utils
/
build.rs
6 lines
65 B
Rust
Raw
Normal View
History
Unescape
Escape
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 03:58:28 +02:00
extern
crate
napi_build
;
fn
main
(
)
{
add entities and two schemas
2023-05-25 08:34:48 +02:00
napi_build
::
setup
(
)
;
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 03:58:28 +02:00
}
Reference in New Issue
Copy Permalink