Skip to content

NewCarbon() performance optimization #319

@Agility6

Description

@Agility6

Hey, I compared versions v2.6.2 and v2.5.0 and found that the NewCarbon() method in 2.6.2 might have performance issues.

  1. v2.5.0 fetches Location via time.LoadLocation() — system call overhead
  2. v2.6.2 fetches Location via ReadFile + Unmarshal — I/O + JSON processing introduces performance loss
Image

Performance optimization for v2.6.2 could be achieved through caching.

I'll attempt a PR if feasible.

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