Skip to content

Making getting the current time faster #1

@bitemyapp

Description

@bitemyapp

This sucks:
https://github.com/bitemyapp/blacktip/blob/master/src/Database/Blacktip.hs#L45

Worse, it sucks in multiple ways.

First:

(round . (*1000))

round is slow-as. The (*1000) ideally wouldn't even be necessary.

Second:

PSX.getPOSIXTime originates in a syscall and goes through like 3 redundant transformations before I get anything out of it. This is slow and unnecessary! Ideally we'd want a millisecond-resolution with the same 64-bit representation in as little work as is possible.

Worth noting that getPOSIXTime doesn't guarantee monotonicity. I don't know how likely of a problem that is.

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