Skip to content

Consider switching from chrono to jiff #7852

@drinkcat

Description

@drinkcat

Based on discussion in #7849, it seems like it would be interesting to use jiff instead of chrono, at the very least in date: this would make our life easier when handling timezones.

Dirty branch here: https://github.com/drinkcat/coreutils/tree/jiff-dirty .

I'll keep modifying this comment as I find issues.

  • Format specifiers that are not supported:
    • %q (quarters)
    • %N (nanoseconds, for chrono we manually replaced this with %f)
    • %X (localization issue, can be replaced manually with %H:%M:%S for now, I think localization is also TBD in coreutils)
    • %:::z (see Some input in date are panicking the binary #3780)
  • In ls, we need to print dates using the same format over and over again. chrono provides an optimized API for that use case: we parse the format string once, then use that to print many times (see fc6b896). I didn't do any benchmarking yet, but I suspect this might be an issue.

@BurntSushi FYI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions