Skip to content

partial_ratio freezes on extremely long strings #430

@alexisdrakopoulos

Description

@alexisdrakopoulos

I was running partial_ratio on millions of strings and saw my program was randomly freezing. Upon further investigation I saw that if I cut off my strings at 5000 characters it no longer froze. It doesn't matter how long I left my program running the freezing persisted.

Not only did it freeze but it doesn't respond to interrupt commands. Here is a simple example:

from rapidfuzz import fuzz

test_str = "hello" * 10000
# test_str = test_str[:5000]
fuzz.partial_ratio(test_str, test_str)
print("hi")

uncomment the line to unfreeze. Note this will freeze.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions