{"id":13503113,"url":"https://github.com/andylokandy/smallbox","last_synced_at":"2025-10-04T08:21:47.947Z","repository":{"id":47652992,"uuid":"92652351","full_name":"andylokandy/smallbox","owner":"andylokandy","description":"Small Box optimization: store small item on stack and fallback to heap for large item.","archived":false,"fork":false,"pushed_at":"2025-07-02T09:22:04.000Z","size":926,"stargazers_count":90,"open_issues_count":1,"forks_count":17,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-15T07:37:02.589Z","etag":null,"topics":["alloc","box","dst","rust-lang","stack"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andylokandy.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,"zenodo":null}},"created_at":"2017-05-28T09:41:44.000Z","updated_at":"2025-09-10T12:49:17.000Z","dependencies_parsed_at":"2023-10-20T17:17:03.145Z","dependency_job_id":"0e012a0c-e78a-4385-bb76-0f141a7caa40","html_url":"https://github.com/andylokandy/smallbox","commit_stats":{"total_commits":89,"total_committers":11,"mean_commits":8.090909090909092,"dds":0.1573033707865169,"last_synced_commit":"f312112479e0e1ccd8d323a6c79fd78dd357b2fb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/andylokandy/smallbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylokandy%2Fsmallbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylokandy%2Fsmallbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylokandy%2Fsmallbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylokandy%2Fsmallbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andylokandy","download_url":"https://codeload.github.com/andylokandy/smallbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andylokandy%2Fsmallbox/sbom","scorecard":{"id":195334,"data":{"date":"2025-08-11","repo":{"name":"github.com/andylokandy/smallbox","commit":"70396c9108baca9932a61a8f3574d8f9ac88a6fa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Code-Review","score":4,"reason":"Found 11/23 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":6,"reason":"7 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/andylokandy/smallbox/ci.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   8 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: MIT License: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T21:44:01.356Z","repository_id":47652992,"created_at":"2025-08-16T21:44:01.356Z","updated_at":"2025-08-16T21:44:01.356Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278284043,"owners_count":25961422,"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-04T02:00:05.491Z","response_time":63,"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":["alloc","box","dst","rust-lang","stack"],"created_at":"2024-07-31T22:02:37.589Z","updated_at":"2025-10-04T08:21:47.942Z","avatar_url":"https://github.com/andylokandy.png","language":"Rust","readme":"# SmallBox\r\n\r\n[![CI Status](https://github.com/andylokandy/smallbox/actions/workflows/ci.yml/badge.svg)](https://github.com/andylokandy/smallbox/actions/workflows/ci.yml)\r\n[![crates.io](https://img.shields.io/crates/v/smallbox.svg)](https://crates.io/crates/smallbox)\r\n[![Documentation](https://docs.rs/smallbox/badge.svg)](https://docs.rs/smallbox)\r\n[![MSRV 1.80.0](https://img.shields.io/badge/MSRV-1.80.0-green?style=flat-square\u0026logo=rust)](https://www.whatrustisit.com)\r\n[![License](https://img.shields.io/crates/l/smallbox.svg)](https://github.com/andylokandy/smallbox#license)\r\n\r\nA space-efficient alternative to `Box\u003cT\u003e` that stores small values on the stack and falls back to heap allocation for larger values. This optimization can significantly reduce memory allocations and improve performance for applications working with many small objects.\r\n\r\n## Quick Start\r\n\r\nAdd SmallBox to your `Cargo.toml`:\r\n\r\n```toml\r\n[dependencies]\r\nsmallbox = \"0.8\"\r\n```\r\n\r\n### Basic Usage\r\n\r\n```rust\r\nuse smallbox::SmallBox;\r\nuse smallbox::space::S4;\r\n\r\n// Small values are stored on the stack\r\nlet small: SmallBox\u003c[u32; 2], S4\u003e = SmallBox::new([1, 2]);\r\nassert!(!small.is_heap());\r\n\r\n// Large values automatically use heap allocation  \r\nlet large: SmallBox\u003c[u32; 32], S4\u003e = SmallBox::new([0; 32]);\r\nassert!(large.is_heap());\r\n\r\n// Use like a regular Box\r\nprintln!(\"Small: {:?}, Large: {:?}\", *small, large.len());\r\n```\r\n\r\n# Benchmark\r\n\r\nThe test platform is Ubuntu 2204 on AMD Ryzen 9 7950X3D 16-Core Processor.\r\n\r\n```\r\ncompare                             fastest       │ slowest       │ median        │ mean          │ samples │ iters\r\n├─ box_large_item                   13.96 ns      │ 14.44 ns      │ 14.2 ns       │ 14.16 ns      │ 100     │ 12800\r\n├─ box_small_item                   7.313 ns      │ 7.512 ns      │ 7.391 ns      │ 7.392 ns      │ 100     │ 25600\r\n├─ smallbox_large_item_large_space  14.13 ns      │ 49.42 ns      │ 14.9 ns       │ 15.07 ns      │ 100     │ 12800\r\n├─ smallbox_large_item_small_space  23.91 ns      │ 26.09 ns      │ 25 ns         │ 24.94 ns      │ 100     │ 6400\r\n├─ smallbox_small_item_large_space  0.995 ns      │ 1.025 ns      │ 1.005 ns      │ 1.003 ns      │ 100     │ 102400\r\n╰─ smallbox_small_item_small_space  0.985 ns      │ 1.015 ns      │ 0.995 ns      │ 0.996 ns      │ 100     │ 102400\r\n```\r\n\r\n## License\r\n\r\nLicensed under either of:\r\n\r\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\r\n- MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\r\n\r\nat your option.\r\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandylokandy%2Fsmallbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandylokandy%2Fsmallbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandylokandy%2Fsmallbox/lists"}