Skip to content

Date/time parsing e.g. when loading a CSV still relies on Exceptions for failure, which is inefficient #7878

@radeusgd

Description

@radeusgd

Currently, our date/time parsing logic, that is used e.g. when loading CSV files is relying on Exceptions to signal parse failure:

protected Object parseSingleValue(String text, ProblemAggregator problemAggregator) {
for (EnsoDateTimeFormatter formatter : formatters) {
try {
return parseStrategy.parse(text, formatter);
} catch (DateTimeParseException ignored) {
// TODO I think ideally we should try to return Option instead of throwing, as throwing is
// inefficient
}
}

As we know, that is not very efficient - especially in GUI mode the stack traces tend to be quite big which incurs a significant performance cost to the parsing.


At some point, we should try to change the implementation to avoid the exceptions - we were already moving in this direction with #6018.

Metadata

Metadata

Assignees

Labels

-libsLibraries: New libraries to be implementedl-datetimeLibraries: date/time utilitiesl-readdatap-lowestShould be completed at some point

Type

No type

Projects

Status

📤 Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions