Windows에서 MinGW-builds(MinGW-w64)를 이용하여 libssh를 빌드하는 경우 유 의점

라이브러리 의존성: zlib, openssl

메모

  • zlib: 큰 문제 없음. mingw32-make -f win32/Makefile.gcc 한방으로 해결 가능
  • openssl: www.mingw.org에서 MSYS를 다운로드받은 후, 소스코드를 MSYS의 tar로 풀어낼것. 그렇지 않은 경우 tarball 안에 있는 symlink가 제대로 처리되지 않음
  • libssh: 두가지 유의사항이 있음
    1. 빌드 디렉토리는 소스코드 디렉토리가 아닌 다른 곳이어야 함
    2. 소스코드 직접 수정 필요: return pthread_self().p를 return pthread_self()로 수정해야 함. 이는 MinGW-builds와 www.mingw.org 양쪽 경우에 대해 pthread 드라이버의 구현 방식이 다르기 때문일 것으로 추측함(소스코드를 비교해보지는 않았음)

Memo on building libssh in Windows with MinGW-builds(MinGW-w64)

Requirements: zlib, openssl

Remarks

  • zlib: Just mingw32-make -f win32/Makefile.gcc and that’s all
  • openssl: Install MSYS from www.mingw.org and use tar on that MSYS package to untar the source tarball. If not, the links on the tarballs are not adequately managed
  • libssh: two things
    1. The build directory should be other than the source tree
    2. You’ve got to edit source code to return pthread_self(), rather than pthread_self().p, which is used under #ifdef _WIN32_. This seems to be because of the differences of pthread implementations between mingw.org and mingw-w64 (though not I didn’t compare the source codes)

QByteArray::indexOf()

QByteArray::indexOf() shows almost the same speed of my implementation of Boyer-Moore-Horspool full string search library based on char*. As Qt has the same source code, chances are GCC 4.8.2 devoted to the performance improvement.

QByteArray::indexOf()

Qt 5.2.1에서 QByteArray::indexOf()가 내가 만든 char* 기반의 Boyer-Moore-Horspool full string search와 거의 동일한 속도를 내고 있다. Qt쪽의 소스코드가 동일한 걸로 봐서 GCC가 4.8.2로 업데이트되면서 나온 최적화 결과인 듯.

Search Speed: Records vs. Full Text Search

If the data can be divided into records, hash table based lookup is more than twice faster than Boyer-Moor-Horspool style full string search.

Example: QMap/QHash vs. QString::indexOf()

검색 속도: 레코드 vs. 텍스트 전체 검색

만일 레코드 단위로 분리가 가능하다면, 해시 테이블 기반의 lookup function이 Boyer-Moore-Horspool 스타일의 full string search보다 2배 이상 빠르다.

예: QMap/QHash vs. QString::indexOf()

블로그를 이전합니다

뭐, 이런 작은 변방의 블로그에 관심있으신 분들은 아무도 없으시리라 생각합니다만...... (웃음) 블로그 플랫폼을 블로거에서 dev.to로 옮겼습니다. 새 URL은 아래와 같습니다: https://dev.to/teminian 새로운 거처에서 뵙겠습니...

Popular in Code{nested}