Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slow when using unique keys as data #126

Open
ionox0 opened this issue Mar 10, 2023 · 0 comments
Open

slow when using unique keys as data #126

ionox0 opened this issue Mar 10, 2023 · 0 comments

Comments

@ionox0
Copy link

ionox0 commented Mar 10, 2023

We noticed that a significant performance improvement to the tree.add(interval) method can be made by commenting out the following line from interval.py:

    def __eq__(self, other):
        """
        Whether the begins equal, the ends equal, and the data fields
        equal. Compare range_matches().
        :param other: Interval
        :return: True or False
        :rtype: bool
        """
        return (
            self.begin == other.begin and
            self.end == other.end # and
            # self.data == other.data
        )

If it is known that all data items are unique (in our case they are), perhaps a parameter for --unique_data would be useful? Happy to include a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant