Skip to content

Eliminate use of self-redefining methods. #2193

@jneen

Description

@jneen

These cause warning spam and can damage performance if it happens at runtime (see #1961).

Requirements here are:

  • Eagerly loading all of Rouge has been slow in the past mostly on account of very large sets of keywords, etc. Perhaps these should be plaintext files instead of ruby source files? Is this still a performance concern in modern Ruby? If so, then loading keywords should be lazy.
  • Maybe introduce MyLexer.eager_load! and/or Rouge.eager_load_all! / require "rouge/all" for apps that really require all languages to be eagerly loaded into memory.
  • Benchmark to ensure we are not incurring a performance regression by pushing logic to runtime nil-checks.
  • The development server should still support hot reloading.

Attempts were made in #2035 and in #1962, but they were missing several requirements and at the time I didn't have the bandwidth to fix them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions