Skip to content

[question] TtlCacheBacking - SystemTime or Instant? #7

@tsnoam

Description

@tsnoam

Hi,

I was looking at this crate, evaluating it for my use.
While examining the code of TtlCacheBacking I've noticed that it's using SystemTime in order to determine the age of a cached entry.

My question is, why SystemTime instead of Instance? Was this due to a problem which you've encountered?

The reason for my questions is a caveat with SystemTime which each call to SystemTime::now() translates to a system call (at least on Linux) - a relatively slow operation.
Under heavy load, the affect of this can be significant.
Instant, on the other hand, does not suffer from the same problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions