pkg_resources.Distribution.hashcmp is slow
See original GitHub issueAs it removes md5 fragment on the fly, pkg_resources.Distribution.hashcmp
is slow:
@property
def hashcmp(self):
return (
self.parsed_version,
self.precedence,
self.key,
_remove_md5_fragment(self.location),
self.py_version or '',
self.platform or '',
)
Would there be side effects if location
is changed into a property where the setter would not only store the location but also store the location without fragment ?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
HashMap with 8 million entries becomes slow - java
First thing is to check the distribution of hashcode. First check that, but with a minor change. The hashcode of a Key inside...
Read more >Optimizing HashMap's Performance - Baeldung
A quick and practical introduction to HashMap performance optimization. ... a hashing function: quality of produced hash codes and speed.
Read more >5 Mundane Java Performance Tips | Richard Startin's Blog
Size HashMaps whenever possible Even if most of its operations are quite fast, resizing HashMap s is slow and hard to optimise, so...
Read more >Things every engineer should know: Hashmaps - Medium
As none of these operations get slower the larger the hashmap grows, the overall operation of inserting into a hashmap also does not...
Read more >Is rust HashMap slower than go's? - Reddit
The Rust HashMap has a default hash function that is designed to prevent HashDoS attacks at the expense of some performance. Try using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The simple example below calls
hashcmp
(thus_remove_md5_fragment
) nearly 1.3 million times:I guess that
setuptools
is the most patholigical case. Nevertheless, trying to obtaindjango
callshashcmp
more than 200k times.It is always better to remove code when possible. Thanks for #2108
To answer your question above about real-world usage, I am in the process of removing
zc.buildout
dependency onsetuptools.easy_install
.In a first phase, I plan to keep the dependency on
setuptools.package_index
. Is there some doc that presents how quick it will be deprecated ?