Skip to content

Instantly share code, notes, and snippets.

View Lazin's full-sized avatar

Eugene Lazin Lazin

  • Redpanda Data
  • The Hague, Netherlands
  • X @Lazin
View GitHub Profile
@Lazin
Lazin / vimdiff.md
Last active August 29, 2015 14:18 — forked from mattratleph/vimdiff.md

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

I've just test std::unordered_map against robin hood hash - https://gist.github.com/Lazin/e033fb1e0641332e28ca (based on this code - https://gist.github.com/ssylvan/5538011).
Insertion:
std::unordered_map:
-------avg 0.00170812
----median 0.00168089
----stddev 4.17363e-09
-------min 0.00166761
-------max 0.00255526
robin-hood hashing:
#include <iostream>
#include <deque>
#include <vector>
#include <unordered_map>
#include <algorithm>
namespace perf {
class Timer
{
public:
Main Talks:
-----------
Please, no More Minutes, Milliseconds, Monoliths... or Monitoring Tools!
Adrian Cockcroft
http://vimeo.com/95064249
http://www.slideshare.net/adriancockcroft/monitorama-please-no-more
Computers are a Sadness, I am the Cure
James Mickens
http://vimeo.com/95066828
void do_read()
{
auto self(shared_from_this());
socket_.async_read_some(boost::asio::buffer(data_, max_length),
[this, self](boost::system::error_code ec, std::size_t length)
{
if (!ec)
{
do_write(length);
}
  1. General Background and Overview
___ Begin jemalloc statistics ___
Version: 3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136
Assertions disabled
Run-time option settings:
opt.abort: false
opt.lg_chunk: 22
opt.dss: "secondary"
opt.narenas: 32
opt.lg_dirty_mult: 3
opt.stats_print: false
#include <iostream>
#include <vector>
#include <boost/pool/pool.hpp>
#include <boost/timer.hpp>
#include <jemalloc/jemalloc.h>
using namespace std;
const size_t COUNT = 1000000;
const size_t SMALL_OBJ_SIZE = sizeof(int);
class RWLock {
pthread_rwlock_t rwlock_;
public:
RWLock()
: rwlock_ PTHREAD_RWLOCK_INITIALIZER
{
}
...
};
#include <iostream>
#include <tuple>
#include <vector>
#include <algorithm>
#include <boost/timer.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/heap/skew_heap.hpp>
#include <google/profiler.h>
using namespace std;