Skip to content

[debt] make XML::RelaxNG.read_memory an alias for XML::RelaxNG.new #2113

@flavorjones

Description

@flavorjones

The method XML::RelaxNG.read_memory is intended to be a factory method for creating a new schema from the string contents of the schema file.

But ... this is exactly what XML::Schema.new does. And under the hood, libxml2 is still calling the same parsing code, so I would be surprised if it was any faster.

This duplication introduces debt to the codebase because it's another path we need to test (note: we're not doing a good job of this already), and the fact that we've begun to have to add workarounds for libxml2 misbehavior (see #1985) and it's not clear if we need to add it to both code paths or what.

Anyway, here's what I want:

  1. benchmark the two paths, make sure there isn't a performance reason to keep read_memory around
  2. remove read_memory and make it an alias for XML::Schema.new

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions