Skip to content

Conversation

@nevans
Copy link
Collaborator

@nevans nevans commented Oct 21, 2023

  • Converted the case statement to use upcase'd strings (not regexps)
  • Unified response_data and numeric_response into a single case statement, using a regexp for lookahead.
  • Sorted the case statement roughly in the order of frequency... but I need to collect more data to reliably make a claim about that. In the meantime, this order made sense to me... more or less. Current standard (both RFC3501 and RFC9051) responses are (mostly) sorted first, and deprecated, uncommon, unsupported, etc responses are sorted last.

Several versions were tried: `Hash[name].call`, `case name when regexp`,
`case name.to_sym`, etc, but benchmarks clearly showed `case
string.upcase when "str"` as fastest.

This change also documents which RFC covers which response types.
Use `peek_re(RE_RESPONSE_TYPE)` and the `TAGGED_EXT_LABEL` regexp, to
unify numeric and non-numeric types in the same case stmt.  This is much
simpler than two tier version, but I don't have benchmarks as to whether
or not this version of the code performs any better.

Add aliases for nz-number.  Not validating that the numbers are within
their allowed range, for now at least.
The case statement is sorted _roughly_ in the order of frequency...
but I need to collect more data to reliably make a claim about that.

In the meantime, this order made sense to me... more or less.

Current standard (both RFC3501 and RFC9051) responses are sorted first,
and deprecated, uncommon, unsupported, etc responses are sorted last.
@nevans nevans merged commit 5a92c75 into master Oct 21, 2023
@nevans nevans deleted the parser/better-faster-cleaner-response_data branch October 21, 2023 23:57
@nevans nevans added the performance related to CPU use, memory use, latency, etc label Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance related to CPU use, memory use, latency, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant