Originally posted by funfunctor
View Post
Announcement
Collapse
No announcement yet.
Another Potential CPU Optimization For Mesa: Quadratic Probing
Collapse
X
-
Originally posted by marek View PostAlso, standard libraries are not always optimized or designed to be fast in the first place.Last edited by pal666; 08 February 2017, 08:32 PM.
Comment
-
Originally posted by marek View Post
This is an interesting point, but the C language is not to blame. Programmers are, because they love re-inventing stuff. Also, standard libraries are not always optimized or designed to be fast in the first place.
One of the major lessons I learned from Haskell was type-directed programming - setting out my types and thinking about the mappings between them right at the end - a sort of "programming with types not functions". It is hard to explain unless you experienced it first hand. Type-dependent languages continue to push that bar to the point that the compiler can start inferring what you mean and write partial functions for you, its really amazing stuff but by large most programmers don't wanna know and dismiss it all as "language fad" so we are stuck with a fetishism for undefined behavior in languages with little to no type system, bashing away in the same old situation never to change.
I have to say I am impressed at Mozilla for taking this stuff more seriously with Rust, such a large codebase with such high complexity will be a great role model for the rest of the ecosystem that you can make powerful software in modem languages and get the benefits that come with that.
Comment
-
Originally posted by pal666 View Postrust can't replace c. it is not compatible and it is not proper language with iso standard and several mature implementations. it is a toy
- Likes 1
Comment
-
Originally posted by pal666 View Postrust can't replace c. it is not compatible and it is not proper language with iso standard and several mature implementations. it is a toy
C++ containers were not designed for speed. They were designed to be generic and useful for common scenarios. https://en.wikipedia.org/wiki/Standa...ibrary#History
They've started to adapt to more specific containers that are better for some scenarios such as unordered_map (which arguably should be used more often than an ordered map) but they don't pertain to how fast the containers are meant to be at all.
- Likes 2
Comment
-
This yields an approximate 10% reduction in shader-db runtime.
and so we should be able to completely fill the table.
Regarding C: I don't see a problem writing things like generic hash tables in C (at least as long as you are comfortable using function pointers, speaking generally). I don't really understand why that isn't happening on a larger scale on Linux (there surely are various libraries existing on a smaller scale), except there are so many possibilities and different priorities.
Comment
-
Originally posted by indepe View PostI suppose this doesn't mean the intention is to actually work with a full table, as that would surely diminish performance, even if possible with that algo and table sizes.
Comment
-
hjahre is spot on. It just means that the hashtable can be filled to the brim without failing. That does not mean that it should be filled to the brim. Currently our load factor is 70% for a big table, but slightly higher when it is tiny.
One can argue whether rolling our own hashtable is ideal, but it does give some advantages. No external dependencies, and high compatibility, which is kind of important since it will have to be built on Windows, Linux, BSD's, etc. Another thing is that we can tune it to our usecase, which might be of interest in some cases.
- Likes 3
Comment
-
Originally posted by CrystalGamma View PostIt's really sad that this is the kind of optimization that people have to write, just because every nontrivial C project still has to write their own data structure implementations (which can have their own bugs and all), mostly because C is so poorly suited to generic programming. To be clear, this would not be a problem if this were a specific hashmap used in a specific part of code with special requirements, but this is the hash table used in all of mesa.
Comment
Comment