Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
avoid-breaking-exported-api = false
5 changes: 5 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# groups 'use' statements by crate
imports_granularity = "crate"
# formats code within doc tests
# requires: cargo +nightly fmt (otherwise rustfmt will warn, but pass)
format_code_in_doc_comments = true
49 changes: 39 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
## 2023-04-12, Version 3.0.0
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- next-header -->

## [Unreleased] - ReleaseDate

### Added

### Changed

* Use new version of `random-access-storage` that returns owned futures.
* Bump edition to 2024.
* Remove `async-trait` dependency.

### Removed



## [3.0.0] - 2023-04-12
### Commits
- [[`ef600832dd`](https://github.com/datrs/random-access-memory/commit/ef600832ddc13d2ba90250ef710a9e0b142e4bad)] Release 3.0.0 (Timo Tiuraniemi)
- [[`e6d7e97ed1`](https://github.com/datrs/random-access-memory/commit/e6d7e97ed1ca4e953a8279e79b614db15562b999)] Switch from Travis to GHA (Timo Tiuraniemi)
Expand Down Expand Up @@ -31,7 +54,7 @@
```


## 2020-03-03, Version 2.0.0
## [2.0.0] - 2020-03-03
### Commits
- [[`cab67711c4`](https://github.com/datrs/random-access-memory/commit/cab67711c42f6229fcf01fac0bfae0b5d0a3fe86)] (cargo-release) version 2.0.0 (Bruno Tavares)
- [[`fc07e9cfef`](https://github.com/datrs/random-access-memory/commit/fc07e9cfefdc808f950fada80df7bfe697eaad6d)] Implement async API for random-access-storage (#26) (Bruno Tavares)
Expand All @@ -51,7 +74,7 @@
```


## 2020-03-03, Version 1.2.0
## [1.2.0] - 2020-03-03
### Commits
- [[`d9fbf73cf1`](https://github.com/datrs/random-access-memory/commit/d9fbf73cf182e6f02e5adc4c016afe38e8650a88)] (cargo-release) version 1.2.0 (Bruno Tavares)
- [[`0b845fbcc7`](https://github.com/datrs/random-access-memory/commit/0b845fbcc747093d8c9eae972e92c8d4a692a208)] Move from failure to use stderr (#25) (Bruno Tavares)
Expand All @@ -64,7 +87,7 @@
```


## 2019-04-24, Version 1.0.0
## [1.0.0] - 2019-04-24
### Commits
- [[`a7ff8ea564`](https://github.com/datrs/random-access-memory/commit/a7ff8ea564f11673b3e39d605befe9b25fc58574)] (cargo-release) version 1.0.0 (Yoshua Wuyts)
- [[`76c0ebfe1b`](https://github.com/datrs/random-access-memory/commit/76c0ebfe1ba046871430f03fe5876a4e27554fb6)] Update random-access-storage to 2.0.0 (#12) (Jack Jennings)
Expand All @@ -86,7 +109,7 @@
```


## 2018-08-30, Version 0.5.0
## [0.5.0] - 2018-08-30
### Commits
- [[`3baa7c2d23`](https://github.com/datrs/random-access-memory/commits/3baa7c2d23dfa774ac5e1d2b38bbb171eaf95bc0)] (cargo-release) version 0.5.0 (Yoshua Wuyts)
- [[`300ead96ab`](https://github.com/datrs/random-access-memory/commits/300ead96ab4eab5b66f786f3b0562ddb29571d27)] Random access always open (#4) (Szabolcs Berecz)
Expand All @@ -106,14 +129,14 @@
```


## 2018-08-23, Version 0.4.0
## [0.4.0] - 2018-08-23
### Commits
- [[`7876a1a1ca`](https://github.com/datrs/random-access-memory/commits/7876a1a1ca10913a6126b767f4d07c3bae99dd8e)] (cargo-release) version 0.4.0 (Yoshua Wuyts)
- [[`cc83784775`](https://github.com/datrs/random-access-memory/commits/cc83784775a7cc737c97d514e88cdcb9ca2e718a)] upgrade random-access-storage (#3)

* upgrade random-access-storage
* cargo fmt (Yoshua Wuyts)
* upgrade random-access-storage

* cargo fmt (Yoshua Wuyts)
- [[`fae1a6509b`](https://github.com/datrs/random-access-memory/commits/fae1a6509b3c3825b3c063a627f64f85ab11cf40)] fix rustfmt in travis.yml (Yoshua Wuyts)
- [[`51c944434b`](https://github.com/datrs/random-access-memory/commits/51c944434b46c16ef7ba4028ac31ec10d6d64fe3)] fix benches (Yoshua Wuyts)
- [[`abfd505e04`](https://github.com/datrs/random-access-memory/commits/abfd505e049da526af068f475c1e8730e33238b9)] (cargo-release) start next development iteration 0.3.1-alpha.0 (Yoshua Wuyts)
Expand All @@ -128,4 +151,10 @@
5 files changed, 23 insertions(+), 16 deletions(-)
```


<!-- next-url -->
[Unreleased]: https://github.com/datrs/random-access-memory/compare/v3.0.0...HEAD
[3.0.0]: https://github.com/datrs/random-access-memory/compare/v2.0.0...v3.0.0
[2.0.0]: https://github.com/datrs/random-access-memory/compare/v1.2.0...v2.0.0
[1.2.0]: https://github.com/datrs/random-access-memory/compare/v1.0.0...v1.2.0
[1.0.0]: https://github.com/datrs/random-access-memory/compare/v0.5.0...v1.0.0
[0.5.0]: https://github.com/datrs/random-access-memory/compare/v0.4.0...v0.5.0
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
[package]
name = "random-access-memory"
version = "3.0.0"
version = "4.0.0-alpha"
license = "MIT OR Apache-2.0"
repository = "https://github.com/datrs/random-access-memory"
documentation = "https://docs.rs/random-access-memory"
description = "Continuously read and write to memory using random offsets and lengths"
authors = ["datrs <yoshuawuyts@gmail.com>", "Timo Tiuraniemi <timo.tiuraniemi@iki.fi>"]
readme = "README.md"
edition = "2021"
edition = "2024"

[dependencies]
random-access-storage = "5.0.0"
async-trait = "0.1"
random-access-storage = "=6.0.0-alpha"
intmap = "2.0.0"

[dev-dependencies]
proptest = "1.1.0"
proptest-derive = "0.2.0"
proptest-derive = "0.8.0"
async-std = { version = "1.12.0", features = ["attributes"] }
criterion = "0.4"

Expand Down
90 changes: 45 additions & 45 deletions benches/sync.rs
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};
use random_access_memory as ram;
use random_access_storage::RandomAccess;

fn write_hello_world(c: &mut Criterion) {
c.bench_function("write hello world", |b| {
b.iter(|| {
async_std::task::block_on(async {
let mut file = ram::RandomAccessMemory::default();
file.write(0, b"hello").await.unwrap();
file.write(5, b" world").await.unwrap();
})
})
});
c.bench_function("write hello world", |b| {
b.iter(|| {
async_std::task::block_on(async {
let file = ram::RandomAccessMemory::default();
file.write(0, b"hello").await.unwrap();
file.write(5, b" world").await.unwrap();
})
})
});
}

fn read_hello_world(c: &mut Criterion) {
c.bench_function("read hello world", |b| {
async_std::task::block_on(async {
let mut file = ram::RandomAccessMemory::default();
file.write(0, b"hello").await.unwrap();
file.write(5, b" world").await.unwrap();
b.iter(|| {
c.bench_function("read hello world", |b| {
async_std::task::block_on(async {
let _text = file.read(0, 11).await.unwrap();
let file = ram::RandomAccessMemory::default();
file.write(0, b"hello").await.unwrap();
file.write(5, b" world").await.unwrap();
b.iter(|| {
async_std::task::block_on(async {
let _text = file.read(0, 11).await.unwrap();
})
});
})
});
})
});
});
}

fn read_write_hello_world(c: &mut Criterion) {
c.bench_function("read/write hello world", |b| {
b.iter(|| {
async_std::task::block_on(async {
let mut file = ram::RandomAccessMemory::default();
file.write(0, b"hello").await.unwrap();
file.write(5, b" world").await.unwrap();
let _text = file.read(0, 11).await.unwrap();
})
})
});
c.bench_function("read/write hello world", |b| {
b.iter(|| {
async_std::task::block_on(async {
let file = ram::RandomAccessMemory::default();
file.write(0, b"hello").await.unwrap();
file.write(5, b" world").await.unwrap();
let _text = file.read(0, 11).await.unwrap();
})
})
});
}

fn write_del_hello_world(c: &mut Criterion) {
c.bench_function("write/del hello world", |b| {
b.iter(|| {
async_std::task::block_on(async {
let mut file = ram::RandomAccessMemory::default();
file.write(0, b"hello world").await.unwrap();
file.del(0, 5).await.unwrap();
file.del(5, 6).await.unwrap();
})
})
});
c.bench_function("write/del hello world", |b| {
b.iter(|| {
async_std::task::block_on(async {
let file = ram::RandomAccessMemory::default();
file.write(0, b"hello world").await.unwrap();
file.del(0, 5).await.unwrap();
file.del(5, 6).await.unwrap();
})
})
});
}

criterion_group!(
benches,
write_hello_world,
read_hello_world,
read_write_hello_world,
write_del_hello_world,
benches,
write_hello_world,
read_hello_world,
read_write_hello_world,
write_del_hello_world,
);
criterion_main!(benches);
7 changes: 7 additions & 0 deletions release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pre-release-replacements = [
{file="CHANGELOG.md", search="Unreleased", replace="{{version}}"},
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1},
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}"},
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n\n## [Unreleased] - ReleaseDate\n\n### Added\n\n### Changed\n\n### Removed\n\n", exactly=1},
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/datrs/random-access-memory/compare/{{tag_name}}...HEAD", exactly=1},
]
Loading
Loading