Skip to content

Improve decoding for NaiveDateTime in RowBinary #319

@ruslandoga

Description

@ruslandoga
# current — allocates a DateTime only to immediately discard it
dt = DateTime.from_unix!(s)
dt = case timezone do
  nil -> DateTime.to_naive(dt)  # ← throws away the DateTime
  ...
end

# faster — go direct
nil -> NaiveDateTime.from_gregorian_seconds(s + @epoch_gregorian_seconds)

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