Skip to content

Optimize the parser #9

@remkade

Description

@remkade

The parser is pretty simple right now and only has 2 paths that both could probably be optimized.

Current Status

Here's the current structure:

  1. Start by attempting an implicit parse (python 3.10.0 style) with implicit_parser().
  2. If success, return simple MatchSpec.
  3. Otherwise, backtrack and begin using full_matchspec_parser() which implements the exhaustive spec.

Possible Approaches

Optimize for Real World Parsing

If someone has the time, it would be ideal to collect some data from the main, conda-forge, and bioconda repodata.json files and try to target a parser towards the most common types of matchspecs. I think its unlikely that channel/subdir are used often, so finding a way to make that package >= 1.0.0 style case faster might work on real world use cases.

General Optimizations

Another approach that would definitely have a lot of potential is to explore just general code optimizations. So far there has been very little time spent on this, so I'm sure someone with the skill and knowledge of nom could really improve the parsing speed.

Metadata

Metadata

Labels

No labels
No labels

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions