{"id":21389334,"url":"https://github.com/coriolinus/tokio-lock-experiment","last_synced_at":"2025-08-01T08:15:41.603Z","repository":{"id":262673220,"uuid":"887997615","full_name":"coriolinus/tokio-lock-experiment","owner":"coriolinus","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-13T17:46:26.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T00:28:40.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/coriolinus.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-13T16:30:25.000Z","updated_at":"2024-11-13T17:46:29.000Z","dependencies_parsed_at":"2024-11-13T17:35:41.762Z","dependency_job_id":"ff6b0281-3192-450f-b000-ec8c97710b54","html_url":"https://github.com/coriolinus/tokio-lock-experiment","commit_stats":null,"previous_names":["coriolinus/tokio-lock-experiment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Ftokio-lock-experiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Ftokio-lock-experiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Ftokio-lock-experiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coriolinus%2Ftokio-lock-experiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coriolinus","download_url":"https://codeload.github.com/coriolinus/tokio-lock-experiment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871651,"owners_count":20361377,"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","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":[],"created_at":"2024-11-22T12:23:46.770Z","updated_at":"2025-03-16T12:45:12.256Z","avatar_url":"https://github.com/coriolinus.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tokio Lock Experiment\n\nThis project attempts to answer these questions:\n\n- Is it possible to use the sync primitives (`Mutex` etc) from tokio with an arbitrary non-tokio executor?\n- Is there any significant build time difference between tokio and async-lock?\n- Is there any significant performance difference between tokio and async-lock?\n\n## How to run\n\nFirst start the server (see below), then check a local browser at `localhost:8000`.\n\n### Async-Lock\n\n```sh\ncargo run --features async-lock\n```\n\n### Tokio\n\n```sh\ncargo run --features tokio\n```\n\n\n## Is it possible?\n\nYes, this project works properly both with either `tokio` or `async-lock` features enabled.\n\n## Is there a significant build-time difference?\n\n| Command | Mean [s] | Min [s] | Max [s] | Relative |\n|:---|---:|---:|---:|---:|\n| `cargo build --release --features async-lock` | 5.486 ± 0.240 | 5.101 | 5.844 | 1.00 |\n| `cargo build --release --features tokio` | 6.022 ± 0.148 | 5.822 | 6.293 | 1.10 ± 0.06 |\n\nThe difference is measurable--about 1.1x--but not significant.\n\n## Is there a significant build-size difference?\n\n```sh\n$ cargo build --release --no-default-features --features tokio \u0026\u0026 mv target/release/tokio-lock-experiment ex.tokio\n   Compiling tokio-lock-experiment v0.1.0 (/home/coriolinus/projects/coriolinus/tokio-lock-experiment)\n    Finished `release` profile [optimized] target(s) in 6.38s\n$ cargo build --release --no-default-features --features async-lock \u0026\u0026 mv target/release/tokio-lock-experiment ex.async-\nlock\n   Compiling tokio-lock-experiment v0.1.0 (/home/coriolinus/projects/coriolinus/tokio-lock-experiment)\n    Finished `release` profile [optimized] target(s) in 0.55s\n$ file ex.*\nex.async-lock: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=21790d2150c653fb0b89b2dfbf4277fde32d0872, for GNU/Linux 3.2.0, not stripped\nex.tokio:      ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9097d32a203dc2c3ffa3dc777fceb4190cbf4be9, for GNU/Linux 3.2.0, not stripped\n$ ls -l ex.*\n-rwxr-xr-x 2 coriolinus coriolinus 800032 Nov 13 18:42 ex.async-lock\n-rwxr-xr-x 2 coriolinus coriolinus 800248 Nov 13 18:41 ex.tokio\n```\n\nNo.\n\n## Is there any significant performance difference?\n\nTBD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoriolinus%2Ftokio-lock-experiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoriolinus%2Ftokio-lock-experiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoriolinus%2Ftokio-lock-experiment/lists"}