This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Related to discussion of | |
http://larshagencpp.github.io/blog/2016/05/01/a-cache-miss-is-not-a-cache-miss | |
at https://twitter.com/gregerlars/status/726781584481878017 | |
Three variants: | |
- Simple: cacheS | |
- Pointer: cacheP | |
- LinkedList: cacheL | |
Context -- looking at average stall durations, we can confirm that cacheL wastes considerably more instruction slots than cacheP, which wastes only somewhat more instruction slots than cacheS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Boost.Hana solution | |
// issue: http://baptiste-wicht.com/posts/2015/07/simulate-static_if-with-c11c14.html | |
// docs w/ explanation: http://ldionne.com/hana/#tutorial-introspection-is_valid | |
#include <iostream> | |
#include <string> | |
#include <boost/hana.hpp> | |
auto has_pop_back = boost::hana::is_valid([](auto && obj) -> decltype(obj.pop_back()) { }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
int main() | |
{ | |
cout << "Hello! \n"; | |
return 0; | |
} |
NewerOlder