commit | e05fefd48b57c600193117da8035d729f3ac3e0e | [log] [tgz] |
---|---|---|
author | Taylor Cramer <cramertj@google.com> | Thu Feb 16 18:47:27 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Feb 16 18:47:27 2023 +0000 |
tree | 1e5c0424e540c7395e64834b57ffbfdcbd578e54 | |
parent | 6dd8df34fc8d17c2129143faaddf5d8e6f1917f4 [diff] |
pw_tokenizer: Use datetime.isoformat The isoformat functions are quite a bit faster than their format string equivalents, and the `parse_csv` function is quite performance-sensitive as this loop is run once for every token in a token database. This change noticeably improved the performance of one downstream consumer. N.B.: Token databases which represented dates using months and days that were not padded two two digits will no longer be successfully loaded. It doesn't seem like any such databases should have been generated before using the old format string approach, but the previous format-string based loading seems to have supported reading these types of entries. Bug: b/269511233 Change-Id: I01e6ef7a944d38190cddad90cf49d841efedbd68 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/129451 Pigweed-Auto-Submit: Taylor Cramer <cramertj@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.