Skip to content

Instantly share code, notes, and snippets.

@micbou
micbou / gist:2c741dfa47ad3a7f33135c0f2f03c44f
Last active December 4, 2018 22:38
Library size and compile time comparison

Comparison of the compilation time and the resulting size of the ycm_core.so library on three different platforms:

After
Platform Compilation time (s) Library size (MB)
Before
@micbou
micbou / libclang.cpp
Last active July 8, 2018 11:57
libclang macro redefinition bug
#include <iostream>
#include <string>
#include <clang-c/Index.h>
const char *flags[] = {
"clang",
"-isystem", "include",
"-DTEST=2"
};
@micbou
micbou / measure.py
Last active June 20, 2018 22:32
Completion measurements of some common modules with Jedi for Python 2.7 and 3.6 environments
import jedi
import sys
import time
def measure(module, version):
sys.stdout.write('Completing {} in '.format(module))
code = 'import {0}\n{0}.'.format(module)
environment = jedi.get_system_environment(version)
# Warmup
@micbou
micbou / profile-filter-and-sort-candidates.md
Last active April 11, 2018 18:30
ycmd performance comparison between Python.Boost and pybind11

Performance comparison of the FilterAndSortCandidates function between Python.Boost and pybind11 on three different platforms.

pybind11
Platform Python 2 (ms) Python 3 (ms)
Python.Boost
@micbou
micbou / bench-sso
Created February 24, 2018 00:38
Benchmark comparison between std::vector< uint8_t > and std::string with MSVC 15
Run on (4 X 3504 MHz CPU s)
02/24/18 01:14:35
---------------------------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------------------------------------------------------------
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/0 925 ns 939 ns 747858
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/0 5673 ns 5702 ns 112179
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/0 103281 ns 104293 ns 7479
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/0 1913831 ns 1899143 ns 345
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/0 41943159 ns 42212035 ns 17
@micbou
micbou / bench-vector
Created February 20, 2018 18:19
Benchmark results using std::vector< uint8_t >
Run on (4 X 3504 MHz CPU s)
02/20/18 19:16:16
---------------------------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------------------------------------------------------------
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/0 1020 ns 998 ns 641022
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/0 5685 ns 5563 ns 112179
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/0 103931 ns 102216 ns 6410
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/0 2014011 ns 1960440 ns 374
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/0 42726734 ns 42900275 ns 16
@micbou
micbou / bench-small-vector
Last active February 20, 2018 18:18
Benchmark results using boost::container::small_vector< uint8_t, 6 >
Run on (4 X 3504 MHz CPU s)
02/20/18 19:07:39
---------------------------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------------------------------------------------------------
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/0 932 ns 939 ns 747858
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/0 5295 ns 5284 ns 112179
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/0 97489 ns 95949 ns 7479
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/0 1899456 ns 1918729 ns 374
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/0 42036958 ns 42212035 ns 17
@micbou
micbou / nvim.log
Created February 17, 2018 14:17
Issue exiting nvim-qt when executing Python code after GuiClose
Writing ShaDa file "C:\Users\micbou\AppData\Local\nvim-data\shada\main.shada"
Executing VimLeave Auto commands for "*"
autocommand call GuiClose()
line 0: call GuiClose()
calling function GuiClose()
line 1: call rpcnotify(0, 'Gui', 'Close')
function GuiClose returning #0
@micbou
micbou / .ycm_extra_conf.py
Last active June 7, 2018 14:02
YCM extra conf for MSVC
import os
import re
import subprocess
import platform
CL_VERSION_REGEX = re.compile( '\d{2}.\d{2}.\d{5}(.\d{2})?' )
MSVC_BIN_DIR = os.path.join('..', '..', 'VC')
@micbou
micbou / diagnostic.cpp
Created January 21, 2018 15:41
Incorrect warnings when parsing with libclang in Windows mode
#include <string>
#include <iostream>
#include <clang-c/Index.h>
const char *flags[] = {
"clang",
"--driver-mode=cl",
"-xc++"