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

@total_ordering : Is it required #9

Open
sinhaharsh opened this issue Mar 15, 2023 · 3 comments
Open

@total_ordering : Is it required #9

sinhaharsh opened this issue Mar 15, 2023 · 3 comments

Comments

@sinhaharsh
Copy link
Collaborator

While this decorator makes it easy to create well behaved totally ordered types, it does come at the cost of slower execution and more complex stack traces for the derived comparison methods. If performance benchmarking indicates this is a bottleneck for a given application, implementing all six rich comparison methods instead is likely to provide an easy speed boost.

@sinhaharsh
Copy link
Collaborator Author

I didn't know this decorator has performance issues. I used it so I could use sorted()
Using sorted() helps me generate reports in a reproducible way, ensuring that modalities/sessions are not shuffled everytime. I will add it as a github issue

@sinhaharsh
Copy link
Collaborator Author

let’s review it later, and consider potential alternatives for future..
one could be :
self._sub_nodes = OrderedDict()

@sinhaharsh
Copy link
Collaborator Author

also reviewing the need for sorting in the first place.

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