Wednesday, January 16, 2019

The following script extracts all audio streams from files in current directory

The following script extracts all audio streams from files in current directory

ls |parallel "ffmpeg -i {} 2>&1 |\
 sed -n 's/.*Stream \#\(.\+\)\:\(.\+\)\: Audio\: \([a-zA-Z0-9]\+\).*$/-map \1:\2 -c copy \"{.}.\1\2.\3\"/p' |\
 xargs -n5 ffmpeg -i {} "

Friday, January 26, 2018

memcpy vs strcpy performance

I have made a memcpy vs strcpy performance comparison test. It helps to understand ways to optimize Shuf project.

My results:

execution time 0.107s (8.7 GB/s)
execution time 0.183 (5.1 GB/s)

I have test it with Clang 6.0 and gcc 5.4 and found no big dfference.  

source code:
std::vector<char> buf(1000000000);
size_t bufSize = buf.size();

std::cerr<< "generating\n";
std::generate(begin(buf), end(buf), std::rand); 
std::cerr<< "done\n";
std::vector<size_t> bufLen;
size_t maxLen = 0;
for(size_t i=0;i<bufSize;) {
  char* ptr = (char*)memchr(&buf[0]+i, 0, bufSize-i);
  if(!ptr) break;
  size_t len = ptr - &buf[0] - i + 1;
  maxLen=std::max(maxLen, len);

clock_t c1 = clock();

std::vector<char> tempBuf(maxLen);
size_t total = bufLen.size();

char* ptr = &buf[0];
for(auto it: bufLen) {
  memcpy(&tempBuf[0], ptr, it);

clock_t c2 = clock();
std::cerr<< "memcpy " << (double(c2 - c1) / CLOCKS_PER_SEC) << "\n";

ptr = &buf[0];
for(auto it: bufLen) {
  auto ret = strcpy(&tempBuf[0], ptr);

clock_t c3 = clock();
std::cerr<< "strcpy " << (double(c3 - c2) / CLOCKS_PER_SEC) << "\n";

Sunday, February 12, 2017

Tuesday, February 7, 2017

Video illustrates how Android Chrome renders toolbar and content frames.

Monday, February 6, 2017

Clion indexing Chromium

Wonder how Clion would index huge project like for example Chromium on server CPU (Xeon E5 2686v3)?
The answer is: slowly. It can do it much faster. Using about 15% of CPU resources all the time during indexing.

Monday, January 2, 2017

gclient sync ... Cannot fast-forward merge, attempt to rebase? (y)es / (q)uit / (s)kip

Here is the workaround solution for the problem:

4) gclient sync

Syncing projects:   2% ( 2/84) src-internal

src-internal (ERROR)
[0:00:01] Started.
_____ src-internal at refs/remotes/origin/master
[0:00:05] Cannot fast-forward merge, attempt to rebase? (y)es / (q)uit / (s)kip :

Just push your changes to remote repo.
Seriously. Somehow gclient corectly resolves dependencies when pulling DEPS from remote.

Friday, January 9, 1987


Ivan Khlystov
Saint Petersburg, Russia | +7(996)7890265 (mobile) |
Have knowledge in Machine Learning: NLP, Word2vec, FastText, SVM, text classification,
Experienced in Chromium platform: browser architecture, IPC, JNI, navigation, resources management, building, GN, GRIT, Breakpad, JS security, Android specifics.
Strong technical skills in C/C++, Perl and Linux shell scripting
Familiar with Java, Python, Go
Experience in STL, Boost.
Excellent skills in debugging, optimizing and multithreaded programming.
Experience in Heterogeneous SoC, MIPS and ARC family processors (RTOSes: ThreadX, MQX).
Cheetah Browser Moscow - Saint Petersburg
Founder October 2017 – present time
  • Prototyped Web browser for Android which allows to review and comment on any website.
  • Built browser’s web services for authentication and comments fetching.
  • Produced several Machine Learning and NLP approaches to entity extraction from web pages.
  • Implemented data mining pipeline based on Common Crawl dataset.
  • Researched several techniques on text search, classification and clustering.
Marlin LLC Moscow
Lead C++ Developer November 2016 – October 2017
  • Took lead role in development of Chromium part of Marlin browser (Android). Established team development processes.
  • Developed: top level project architecture, building process, custom navigation for Instant Web mode, Java integration, AdBlockPlus linking, merging with Chromium procedure.
  • Mentored and guided two C++ developers in development process and product knowledge.
  • Took part in C++ developers hiring.
IndoorGeo Moscow
Founder, Researcher February 2016 – November 2016
  • Designed and analyzed indoor Geolocation models.
  • Used approaches: MLAT on WiFi signal level, acc/gyro based SLAM.
  • Took several courses on Machine Learning, Neural Networks, SLAM, statistics.
Sputnik Moscow
Lead Software Developer(Web back-end) March 2014 – February 2016
  • Took part in Sputnik Browser for Windows (chromium based) development. Zones of responsibility: installation, GUI, Net.
  • Developed backend for Sputnik web services.
  • Trained team members in product design and coding techniques.
Rhonda Software Vladivostok
Embedded software engineer (CSR contractor) November 2012 - January 2014
  • Developed and maintained embedded software for Digital Still Cameras.
  • Maintained audio filters and codecs: AAC, ADPCM, IIR.
  • Designed and prototyped Fast Wind Noise Reduction filter.
Luxoft Saint Petersburg
Software Engineer (AMD contractor) July 2012 – November 2012
  • Maintained video features of the recent AMD graphics chips.
  • Fixed User Mode/Kernel Mode bugs on Windows 8 and Linux platforms.
Lumex Instruments Saint Petersburg
Software Engineer February 2011 – July 2012
  • Took part in development of multicell PCR analyzer AriaDNA.
  • Developed algorithms for Peak Finding, Mathematical Optimization, Statistics, Image Recognition.
  • Refactored and optimized legacy multithreading code and mathematical calculation code.
Independent studies April 2010 – January 2011
  • Independent studies in Programming Languages: Python, Lisp, Ruby. Practice in algorithmic problems, LR-parsing.
Siber Systems, Inc Omsk
C++ Developer June 2005 – March 2010
  • Developed new features and enhancements for Roboform application: web forms filling application.
  • Maintained Firefox to IE representation bridge.
  • Redesigned build system.
  • Adopted internal test engine to Firefox.
  • Improved web forms search engine.
Magma-Computer Omsk
Mechanical CAD Software Developer May 2004 – June 2005
  • Developed algorithms for a variety of 2D geometric operations such as computing intersections and projections.
  • Implementing Client Server interface to 3rd party CADs (Autodesk Inventor, CS Spotlight).
Teplokommunenergo Omsk
1C:Predpriyatiye programmer February 2002 - May 2004
  • Made the company’s database distributed over main office and remote site.
Omsktechuglerod Omsk
Embedded engineer October 2001 – February 2002
  • Took part in hardware and firmware development for Monsanto R100S ADC measurement board.
  • Implemented Windows KMD driver and desktop client for ADC board.
Omsk State Technical University
Engineer's degree, Computer systems and networks

The following script extracts all audio streams from files in current directory

The following script extracts all audio streams from files in current directory ls |parallel "ffmpeg -i {} 2>&1 |\ sed -n &...