Skip to content

Conversation

@kstephensic
Copy link
Collaborator

@kstephensic kstephensic commented Jun 13, 2025

  • #__enum_name__ : cache and freeze String.
  • #=== : simplify logic.
  • Use @ivar ||= ... pattern.
  • #name_sym : caching is ~ 15% faster.
  • #to_s is implied in String interpolation.
  • Add frozen_string_literal: true.
  • '#[]' : simplify logic.

Other Ideas, but I didn't want to touch too much:

#name_sym - set it upon model create/load, rather than caching.
#__enum_name__ - dup.freeze model create/load, rather than caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants