Skip to content

speeding up idea: Boyer Moore for all subsequence searches. #6616

@kobi2187

Description

@kobi2187

I had an idea:

  • using a smart string searching algorithm like boyer-moore, would likely speed up all the applications that use string matching in the std lib.
    I assume it'd be possible for byte arrays to use the same algorithm and not just strings, to get a comparable speedup.
  • A related idea is data structures that abstract an algorithm. for example, instead of reversing an array, make a structure that holds this array, and its length, and computes the correct index, as if the array was reversed. 0 would be len-1, 3 would be len -4, -1 would be 0, -2 would be 1.
    something like:
    proc calc(pos:int) = len + (i * -1) -1

There might be other use cases, such as a slice, which is a certain "window" to the underlying sequence.
What do you guys think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions