https://github.com/tikv/minstant

Performant time measuring in Rust

https://github.com/tikv/minstant

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.4%) to scientific vocabulary

Keywords

high-performance high-performance-computing timing tsc
Last synced: 5 months ago · JSON representation

Repository

Performant time measuring in Rust

Basic Info
  • Host: GitHub
  • Owner: tikv
  • License: apache-2.0
  • Language: Rust
  • Default Branch: master
  • Homepage:
  • Size: 226 KB
Statistics
  • Stars: 194
  • Watchers: 13
  • Forks: 20
  • Open Issues: 2
  • Releases: 4
Topics
high-performance high-performance-computing timing tsc
Created over 5 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

minstant

Actions Status Build Status Documentation Crates.io LICENSE

A drop-in replacement for std::time::Instant that measures time with high performance and high accuracy powered by TSC.

Usage

toml [dependencies] minstant = "0.1"

```rust let start = minstant::Instant::now();

// Code snipppet to measure

let duration: std::time::Duration = start.elapsed(); ```

Motivation

This library is used by a high performance tracing library minitrace-rust. The main purpose is to use TSC on x86 processors to measure time at high speed without losing much accuracy.

Platform Support

Currently, only the Linux on x86 or x86_64 is backed by TSC. On other platforms, minstant falls back to std::time. If TSC is unstable, it will also fall back to std::time.

If speed is privileged over accuracy when fallback occurs, you can use fallback-coarse feature to use coarse time:

toml [dependencies] minstant = { version = "0.1", features = ["fallback-coarse"] }

Benchmark

Benchmark platform is Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz on CentOS 7.

```sh

cargo criterion

Instant::now()/minstant time: [10.449 ns 10.514 ns 10.619 ns] Instant::now()/quanta time: [31.467 ns 31.628 ns 31.822 ns] Instant::now()/std time: [26.831 ns 26.924 ns 27.016 ns] minstant::Anchor::new() time: [46.987 ns 47.243 ns 47.498 ns] minstant::Instant::asunixnanos() time: [15.287 ns 15.318 ns 15.350 ns] ```

Benchmark

Owner

  • Name: TiKV Project
  • Login: tikv
  • Kind: organization

GitHub Events

Total
  • Watch event: 22
  • Fork event: 1
Last Year
  • Watch event: 22
  • Fork event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 41
  • Total Committers: 7
  • Avg Commits per committer: 5.857
  • Development Distribution Score (DDS): 0.439
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Zhenchi z****h@o****m 23
Andy Lok a****y@h****m 13
Xuanwo g****b@x****o 1
Dotan Simha d****a@g****m 1
CuteSocks 1****s 1
Bugen Zhao i@b****m 1
A L Manning 1****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 32
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 16 days
  • Total issue authors: 6
  • Total pull request authors: 11
  • Average comments per issue: 0.57
  • Average comments per pull request: 0.41
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • breezewish (2)
  • davidli2010 (1)
  • Stebalien (1)
  • goldwind-ting (1)
  • BugenZhao (1)
Pull Request Authors
  • zhongzc (18)
  • andylokandy (8)
  • 0xd34d10cc (2)
  • xguerin (2)
  • dotansimha (2)
  • A-Manning (1)
  • Xuanwo (1)
  • LemonHX (1)
  • BugenZhao (1)
  • 0xCuteSocks (1)
  • lun3x (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cargo 1,695,199 total
  • Total docker downloads: 1,494
  • Total dependent packages: 23
  • Total dependent repositories: 69
  • Total versions: 8
  • Total maintainers: 2
crates.io: minstant

A drop-in replacement for `std::time::Instant` that measures time with high performance and high accuracy powered by TSC

  • Versions: 8
  • Dependent Packages: 23
  • Dependent Repositories: 69
  • Downloads: 1,695,199 Total
  • Docker Downloads: 1,494
Rankings
Dependent packages count: 2.1%
Docker downloads count: 2.5%
Downloads: 3.1%
Dependent repos count: 3.9%
Average: 6.5%
Stargazers count: 12.8%
Forks count: 14.6%
Maintainers (2)
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions-rs/toolchain v1 composite
  • actions/checkout v2 composite
Cargo.toml cargo
  • criterion 0.3 development
  • quanta 0.9 development
  • rand 0.8 development
  • ctor 0.1.20