Skip to content

[performance][memory] Use cached timezone when decoding values #3482

Description

@chernser

Description

client-v2 made a new UTC ZoneId with ZoneId.of("UTC") for each value in six places. This PR uses the existing constant DataTypeConverter.UTC_ZONE_ID of client-v2 in these places. The constant is equal to ZoneId.of("UTC"), so the written bytes and the returned values do not change.

  • SerializerUtils.serializePrimitiveData (4 places): each Date and Date32 value, and each DateTime and DateTime64 value of a column that has no time zone.
  • AbstractBinaryFormatReader (2 places): getInstant on a Date or Date32 column, and the conversion of a LocalDateTime of a Dynamic or Variant column to an Instant.

Why it matters: on JDK 17, ZoneId.of("UTC") makes a ZoneRegion, new ZoneRules, a ConcurrentHashMap and a ZoneOffset[] on each call. That is 152 bytes of garbage for each value.

There is no issue for this change. It is a small change with no change of behavior.

Activity

  1. added this to the 0.12.0 milestone on Dec 1, 2026
  2. added
    client
    data-types
    on Dec 1, 2026
  3. added theissue type on Dec 1, 2026
  4. changed the issue type fromtoon Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientdata-typesperformance

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions