Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
/ DePacked Public archive

Small Rust crate for handling memory packed data to aid CPU caching

License

Notifications You must be signed in to change notification settings

DigitalExtinction/DePacked

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DePacked

crates.io crates.io

Example

use depacked::PackedData;

struct NeedToPack(u32);

fn main() {
    let mut packed = PackedData::with_max_capacity(1000);

    // Insertin is fast but not as CPU cache friendly.
    let first_item = packed.insert(NeedToPack(0));
    let second_item = packed.insert(NeedToPack(1));

    // Getting (mutable) references is fast and CPU cache friendly.
    let first_ref = packed.get(first_item);
    let second_ref_mut = packed.get_mut(second_item);

    // Removing might be slower.
    let first = packed.remove(first_item);
}

License

DePacked is free and open source! All code in this repository is dual-licensed under either:

at your option.

About

Small Rust crate for handling memory packed data to aid CPU caching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages