#date-time #time #date

temporenc

Library for the Temporenc time/date format

3 releases

Uses old Rust 2015

0.0.3 Feb 7, 2017
0.0.2 Feb 7, 2017
0.0.1 Jan 29, 2017

#402 in Date and time

Download history 208/week @ 2024-07-24 322/week @ 2024-07-31 229/week @ 2024-08-07 310/week @ 2024-08-14 293/week @ 2024-08-21 193/week @ 2024-08-28 286/week @ 2024-09-04 259/week @ 2024-09-11 154/week @ 2024-09-18 106/week @ 2024-09-25 258/week @ 2024-10-02 223/week @ 2024-10-09 360/week @ 2024-10-16 287/week @ 2024-10-23 269/week @ 2024-10-30 215/week @ 2024-11-06

1,166 downloads per month

Custom license

50KB
1K SLoC

Rust library for Temporenc, a binary date/time format.

Great performance is a high priority for this implementation. It uses a different struct for each of the temporal types (date, date and time, etc). This allows for hand-tuned serialization and deserialization logic for each type. There also is no heap allocation (aside from test code, of course).

See below for some sample performance numbers from an i7-6850K (a 3.6Ghz Broadwell-E chip). Batches of 100 are used because time measurement accuracy is poor when single operations only take a few nanoseconds.

Operation Quantity Type Time
Deserialize 100 random date 665ns
Deserialize 100 random date + time 985ns
Deserialize 100 random date + time + offset 974ns
Deserialize 100 random date + time + subsecond 1300ns
Deserialize 100 random date + time + subsecond + offset 1473ns
Deserialize 100 random time 801ns
Serialize 100 random date 288ns
Serialize 100 random date + time 435ns
Serialize 100 random date + time + offset 492ns
Serialize 100 random date + time + subsecond 897ns
Serialize 100 random date + time + subsecond + offset 982ns
Serialize 100 random time 277ns

No runtime deps