This website requires JavaScript.
Explore
Help
Register
Sign In
caio
/
clang-p2996
Watch
1
Star
0
Fork
0
You've already forked clang-p2996
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
a98fde5d70e615e3f8189243399e20b2aa59cd39
clang-p2996
/
libcxx
/
test
History
Howard Hinnant
4cb38a82a2
This commit establishes a new bucket_count policy in the unordered containers: The policy now allows a power-of-2 number of buckets to be requested (and that request honored) by the client. And if the number of buckets is set to a power of 2, then the constraint of the hash to the number of buckets uses & instead of %. If the client does not specify a number of buckets, then the policy remains unchanged: a prime number of buckets is selected. The growth policy is that the number of buckets is roughly doubled when needed. While growing, either the prime, or the power-of-2 strategy will be preserved. There is a small run time cost for putting in this switch. For very cheap hash functions, e.g. identity for int, the cost can be as high as 18%. However with more typical use cases, e.g. strings, the cost is in the noise level. I've measured cases with very cheap hash functions (int) that using a power-of-2 number of buckets can make look up about twice as fast. However I've also noted that a power-of-2 number of buckets is more susceptible to accidental catastrophic collisions. Though I've also noted that accidental catastrophic collisions are also possible when using a prime number of buckets (but seems far less likely). In short, this patch adds an extra tuning knob for those clients trying to get the last bit of performance squeezed out of their hash containers. Casual users of the hash containers will not notice the introduction of this tuning knob. Those clients who swear by power-of-2 hash containers can now opt-in to that strategy. Clients who prefer a prime number of buckets can continue as they have.
...
llvm-svn: 159836
2012-07-06 17:31:14 +00:00
..
algorithms
Fixed PR10574:
http://llvm.org/bugs/show_bug.cgi?id=10574
2011-08-12 21:56:02 +00:00
atomics
libc++: Add some missing #includes to atomics tests. libc++ doesn't need these
2012-04-19 00:50:47 +00:00
containers
This commit establishes a new bucket_count policy in the unordered containers: The policy now allows a power-of-2 number of buckets to be requested (and that request honored) by the client. And if the number of buckets is set to a power of 2, then the constraint of the hash to the number of buckets uses & instead of %. If the client does not specify a number of buckets, then the policy remains unchanged: a prime number of buckets is selected. The growth policy is that the number of buckets is roughly doubled when needed. While growing, either the prime, or the power-of-2 strategy will be preserved. There is a small run time cost for putting in this switch. For very cheap hash functions, e.g. identity for int, the cost can be as high as 18%. However with more typical use cases, e.g. strings, the cost is in the noise level. I've measured cases with very cheap hash functions (int) that using a power-of-2 number of buckets can make look up about twice as fast. However I've also noted that a power-of-2 number of buckets is more susceptible to accidental catastrophic collisions. Though I've also noted that accidental catastrophic collisions are also possible when using a prime number of buckets (but seems far less likely). In short, this patch adds an extra tuning knob for those clients trying to get the last bit of performance squeezed out of their hash containers. Casual users of the hash containers will not notice the introduction of this tuning knob. Those clients who swear by power-of-2 hash containers can now opt-in to that strategy. Clients who prefer a prime number of buckets can continue as they have.
2012-07-06 17:31:14 +00:00
depr
Fix a few testsuite bugs involving trailing null (or lack thereof) in strstream.
2012-06-01 20:02:59 +00:00
diagnostics
Fix
http://llvm.org/bugs/show_bug.cgi?id=11428
. Fix provided by Alberto Ganesh Barbati
2011-12-02 19:36:40 +00:00
input.output
Windows porting work by Ruben Van Boxem
2011-10-03 15:23:59 +00:00
iterators
license change
2010-11-16 22:09:02 +00:00
language.support
Don't refer to a function that doesn't exist in the quick_exit test.
2012-03-14 14:02:15 +00:00
localization
Fix moneypunct_byname algorithm to more accurately represent C locales in C++.
2012-03-10 18:31:43 +00:00
numerics
Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
2012-04-02 21:00:45 +00:00
re
Fix <rdar://problem/10255403> match_results::begin() is off by one
2011-10-08 14:36:16 +00:00
strings
Fix <rdar://problem/10256836> getline of an empty string mistakenly causes failure
2011-10-09 15:20:46 +00:00
thread
update test for explicit bool operator.
2012-02-25 21:43:14 +00:00
utilities
I believe tuple is still under development in the standard. Daniel Krugler is/will be making convincing arguments that a modified form of LWG 2051 (currently NAD Future) is easily acheivable and desirable. He has demonstrated that a tuple<T...> where all of the T are implicitly convertible from U... should have a tuple constructor that is also implicit, instead of explicit. This would support the use cases in LWG 2051 while not undermining T... with explicit conversions from U.... This check-in is an experimental implementation of Daniel's work. I believe this work to be mature enough to warrant inclusion into libc++. If anyone sees real-world problems that this check in causes, please let me know and I will revert it, and provide the feedback to the LWG.
2012-04-01 23:10:42 +00:00
CMakeLists.txt
Allow libc++ to be built with CMake from within the LLVM tree. The libc++ part is just some renaming as the variable was already in use, conflicting with something else in the LLVM tree. Contributed by Ruben Van Boxem.
2012-03-19 15:40:23 +00:00
hexfloat.h
Correction to hexfloat hack.
2011-05-14 14:33:56 +00:00
lit.cfg
Teach the Lit configuration to actually use the cxx0x setting when
2011-01-23 01:05:20 +00:00
lit.site.cfg.in
Add CMake build and fix major Linux blockers.
2010-12-10 19:47:54 +00:00
nothing_to_do.pass.cpp
license change
2010-11-16 22:09:02 +00:00
platform_support.h
Windows porting work by Ruben Van Boxem
2011-10-03 15:23:59 +00:00
testit
libc++: Add some missing #includes to atomics tests. libc++ doesn't need these
2012-04-19 00:50:47 +00:00