{"id":27936200,"url":"https://github.com/enso-org/jvm-native-benchmarks","last_synced_at":"2026-05-07T04:34:53.475Z","repository":{"id":103182081,"uuid":"297962967","full_name":"enso-org/jvm-native-benchmarks","owner":"enso-org","description":"Benchmarks of various methods for transferring data between the JVM and native code.","archived":false,"fork":false,"pushed_at":"2020-09-25T12:38:17.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T06:26:23.786Z","etag":null,"topics":["benchmark","cpp","deserialization","jni","jvm","rust","serialization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enso-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-23T12:29:47.000Z","updated_at":"2020-09-25T12:41:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"3733ac17-b49d-41f8-b1fa-9567020c2feb","html_url":"https://github.com/enso-org/jvm-native-benchmarks","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"a43e0b23ad4835678e0ecee02671e26bcfc63fc9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/enso-org/jvm-native-benchmarks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enso-org%2Fjvm-native-benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enso-org%2Fjvm-native-benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enso-org%2Fjvm-native-benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enso-org%2Fjvm-native-benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enso-org","download_url":"https://codeload.github.com/enso-org/jvm-native-benchmarks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enso-org%2Fjvm-native-benchmarks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004568,"owners_count":26083736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","cpp","deserialization","jni","jvm","rust","serialization"],"created_at":"2025-05-07T06:56:51.168Z","updated_at":"2025-10-10T15:50:04.376Z","avatar_url":"https://github.com/enso-org.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Results \n\n### Serialization\n\n#### Milliseconds / run (Cold Start)\n\n| method      | Leaf=Name(\"x\")  | Leaf=Offset(1)  | Leaf=Position(2,3) |\n|:--          | :--:            |:--:             |:--:                |\n| handwritten | 208             | 142             | 186                |\n| flatbuffers | 463             | 365             | 423                |\n\n#### Milliseconds / run (Average)\n\n| method      | Leaf=Name(\"x\")  | Leaf=Offset(1)  | Leaf=Position(2,3) |\n|:--          | :--:            |:--:             |:--:                |\n| handwritten | 98              | 80              | 92                 |\n| flatbuffers | 338             | 285             | 322                |\n\n\n### AllocObject + SetField\n\n#### Milliseconds / run (Cold Start)\n\n| method      | Leaf=Name(\"x\") | Leaf=Offset(1) | Leaf=Position(2,3) |\n|:--          | :--:           |:--:            | :--:               |\n| Java        | 66             | 34             | 45                 |\n| C++         | 731            | 283            | 302                |\n| Rust        | 1 306          | 434            | 546                |\n| Unsafe Rust | 673            | 415            | 492                |\n\n#### Milliseconds / run (Average)\n\n| method      | Leaf=Name(\"x\") | Leaf=Offset(1) | Leaf=Position(2,3) |\n|:--          | :--:           |:--:            | :--:               |\n| Java        | 10             | 9              | 9                  |\n| C++         | 611            | 258            | 288                |\n| Rust        | 993            | 413            | 472                |\n| Unsafe Rust | 443            | 311            | 307                |\n\n#### Runs / second (Average)\n\n| method      | Leaf=Name(\"x\") | Leaf=Offset(1) | Leaf=Position(2,3) |\n|:--          | :--:           |:--:            | :--:               |\n| Java        | 107.683        | 102.363        | 99.934             |\n| C++         | 1.649          | 4.019          | 3.618              |\n| Rust        | 0.561          | 2.422          | 2.195              |\n| Unsafe Rust | 2.268          | 3.402          | 3.368              |\n\nAll tests construct an `App(fun, arg)` tree with depth=20 that is a copy of a preallocated tree.\nThe objects were constructed with JNI API `AllocObject + SetField`.\n\n- C++: The preallocated tree is of form `App(UniquePtr\u003cAst\u003e, UniquePtr\u003cAst\u003e)`.\n- Rust: The preallocated tree is of form `App(Box\u003cAst\u003e, Box\u003cAst\u003e)`.\n- Unsafe Rust: Uses JNI API directly instead of using the jni rust library.\n\n\n## Steps To Run\n\n#### Linux\n\n1. ```\n   cd rust; cargo build --release; cd ..; cp rust/target/release/rust.so ./rust.so\n   ```\n2. ```\n   cd cpp\n   g++ -std=c++17 -O3 -fPIC -I\"$JAVA_HOME/include\" -I\"$JAVA_HOME/include/linux\" -shared -o cpp.so main.c\n   cd ..\n   cp cpp/cpp.so ./cpp.so\n   ```\n3. run java application with `-Djava.library.path=.`\n  \n \n#### Windows\n\n1. ```\n   cd rust; cargo build --release; cd ..; cp rust/target/release/rust.dll ./rust.dll\n   ```\n2. ```\n   cd cpp\n   g++ -std=c++17 -O3 -fPIC -I\"%JAVA_HOME%/include\" -I\"%JAVA_HOME%/include/windows\" -shared -o cpp.dll main.c\n   cd ..\n   cp cpp/cpp.dll ./cpp.dll\n   ```\n3. run java applicatio with `-Djava.library.path=.`\n  \n  \n#### Mac\n\n1. ```\n   cd rust; cargo build --release; cd ..; cp rust/target/release/rust.dylib ./rust.dylib\n   ```\n2. ```\n   cd cpp\n   g++ -std=c++17 -O3 -fPIC -I\"$JAVA_HOME/include\" -I\"$JAVA_HOME/include/darwin\" -dynamiclib -o cpp.dylib main.c\n   cd ..\n   cp cpp/cpp.dylib ./cpp.dylib\n   ```\n3. run java applicatio with `-Djava.library.path=.`\n  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenso-org%2Fjvm-native-benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenso-org%2Fjvm-native-benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenso-org%2Fjvm-native-benchmarks/lists"}