Skip to content

ucal performance opportunities #1842

@itingliu

Description

@itingliu
  1. ucal_getTimeZoneDisplayName seems to spend a good chunk of time in creating a numbering system. It's not clear why that's needed
  2. ucal_getGregorianChange just reads a constant. There's probably opportunities so we don't have to create a ucal object just for that
  3. ucal_setAttribute, ucal_getAttribute, ucal_getLimit are just setting and reading a variable on the object. However the current implementation uses a String key, and switch through the cases:
ucal_setAttribute(ucalendar, UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, Int32(newValue))

// which calls the following in ICU
switch (key) {
...
case UCAL_FIRST_DAY_OF_WEEK:
      ((Calendar*)cal)->setFirstDayOfWeek((UCalendarDaysOfWeek)newValue);
      break;
}

It'd be nice if we could directly do what you can do with the C++ API.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions