All Projects → tafia → nested

tafia / nested

Licence: MIT License
A memory efficient container for rust nested collections

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to nested

Nuxt Memwatch
Quickly watch real-time memory stats of your nuxt app
Stars: ✭ 76 (+171.43%)
Mutual labels:  memory, heap
o1heap
Constant-complexity deterministic memory allocator (heap) for hard real-time high-integrity embedded systems
Stars: ✭ 119 (+325%)
Mutual labels:  memory, heap
Mysql Magic
dump mysql client password from memory
Stars: ✭ 183 (+553.57%)
Mutual labels:  memory, heap
Heap allocator
A simple heap memory allocator in ~200 lines.
Stars: ✭ 661 (+2260.71%)
Mutual labels:  memory, heap
gctoolkit
Tool for parsing GC logs
Stars: ✭ 1,127 (+3925%)
Mutual labels:  memory, heap
FireflySoft.RateLimit
It is a rate limiting library based on .Net standard.
Stars: ✭ 76 (+171.43%)
Mutual labels:  memory
pydevmem
Python interface to /dev/mem
Stars: ✭ 41 (+46.43%)
Mutual labels:  memory
Algorithm-Data-Structures-Python
Various useful data structures in Python
Stars: ✭ 34 (+21.43%)
Mutual labels:  heap
Reloaded.Assembler
Minimal .NET wrapper around the simple, easy to use Flat Assembler written by Tomasz Grysztar. Supports both x64 and x86 development.
Stars: ✭ 17 (-39.29%)
Mutual labels:  memory
data-structure-and-algorithm
Basic data structures, sorting algorithms, algorithms learning tools. 基本数据结构,排序算法,算法学习工具
Stars: ✭ 86 (+207.14%)
Mutual labels:  heap
bluerain
BlueRain is a fully-featured, managed memory manipulation library written in C#
Stars: ✭ 36 (+28.57%)
Mutual labels:  memory
HelvetaCS
Modern C++ CS:GO base
Stars: ✭ 41 (+46.43%)
Mutual labels:  memory
psutil
Cross-platform lib for process and system monitoring in Python
Stars: ✭ 8,488 (+30214.29%)
Mutual labels:  memory
profiling
Non-discriminatory profiling of Ruby code leveraging the ruby-prof gem
Stars: ✭ 12 (-57.14%)
Mutual labels:  memory
Data-Structures
Algorithmic Problems Solutions -- hash table code featured in geeksforgeeks
Stars: ✭ 44 (+57.14%)
Mutual labels:  heap
redis-key-dashboard
This tool allows you to do a small analysis of the amount of keys and memory you use in Redis. It allows you to see overlooked keys and notice overuse.
Stars: ✭ 42 (+50%)
Mutual labels:  memory
audria
audria - A Utility for Detailed Ressource Inspection of Applications
Stars: ✭ 35 (+25%)
Mutual labels:  memory
os
📖 Operating Systems - A Friendly Handbook 📖 (Open Notes)
Stars: ✭ 35 (+25%)
Mutual labels:  memory
CPU-MEM-monitor
A simple script to log Linux CPU and memory usage (using top or pidstat command) over time and output an Excel- or OpenOfficeCalc-friendly report
Stars: ✭ 41 (+46.43%)
Mutual labels:  memory
numap
No description or website provided.
Stars: ✭ 18 (-35.71%)
Mutual labels:  memory

nested

Build Status Crate

A memory efficient container for nested collections.

This crate is intended to be used when:

  • you want a potentially large:
    • Vec<String>
    • Vec<Vec<T>>
    • Vec<C> where C is heap allocated, dynamically sized and can implement Collection trait
  • you actually only need to use borrowed items (&[T] or &str)

Instead of having n + 1 allocations, you'll only have 2.

Example

use nested::Nested;

let mut v = Nested::<String>::new();

// you can either populate it one by one
v.push("a");
v.push("bb".to_string());
v.push("hhh");
v.extend(vec!["iiiiii".to_string(), "jjjj".to_string()]);
assert_eq!(v.len(), 5);
assert_eq!(&v[0], "a");
assert_eq!(&v[1], "bb");

// or you can directly collect it
let mut v = ["a", "b", "c", "d", "e", "f", "g"].iter().collect::<Nested<String>>();
assert_eq!(v.len(), 7);

// it also provides basic operations
let u = v.split_off(2);
assert_eq!(u.get(0), Some("c"));

v.truncate(1);
assert_eq!(v.pop(), Some("a".to_string()));
assert_eq!(v.pop(), None);

Benches

See benches directory.

Here are the benches for collecting all words in src/lib.rs file:

test bench_nested_string      ... bench:      55,381 ns/iter (+/- 7,852)
test bench_nested_string_iter ... bench:      95,127 ns/iter (+/- 8,253)
test bench_vec_string         ... bench:     117,203 ns/iter (+/- 13,089)
test bench_vec_string_iter    ... bench:     142,245 ns/iter (+/- 24,701)

Licence

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].