跳到主要內容

發表文章

目前顯示的是 5月, 2017的文章

Buck - a new build system

各種程式語言有不同 支持 的 build tools,例如 Javascript 的 glup, grunt, ..., etc. Java 的 ant, maven, gradle, ..., etc. C/C++ 常用的 make, cmake, ..., etc. 而 Buck 是一個新的 build tools ,主要提供一些主流的語言,包括 C/C++, Python, Java, D, React Native, Android, OCaml,特別的它採用的幾個重要的技術: Hashing: 版本控制時,使用 Hashing 來處理,在專案開發階段,不斷地測試是必然的,而僅有少部分需要再度 rebuild,使用 Hashing 來處理差異是很聰明的作法 Parallel: 在 multi-core 的架構下的軟體,支援 Parallel 可以加快 build 的處理速度 Buck 是 facebook 所開發的,是 open source code 的 project,支援不同的作業系統,目前正在開發大型專案的程式設計師,不妨可以一試,看看是否有加快 build 的速度。

發生在 C++ Standard Library 的恐怖事件

在 Twitter 上看到一則 " The Horror in the Standard Library " 這麼聳動的標題,不改好奇的個性,當然要讀他到底在說些什麼?摘錄文章幾個要點: We tried valgrind , dmalloc , the Microsoft Visual Studio memory profiler (yes we tried running it in Windows via an elaborate shim just to use this), and glibc's built-in memory tracing . Nothing worked. It's leaking but it's not. It's leaking but the debugger says no memory was lost.  The default allocator in the standard C library is designed for an acceptable trade-off between memory use and performance under ordinary work loads, but it doesn't always perform ideally in aggressively multithreaded or very high throughput applications. Luckily there are very highly regarded drop-in replacements like jemalloc . Trembling with anticipation that maybe... just maybe... I'd found the answer... I dropped in jemalloc and ran the test. We now have code in production (in ZeroTier Central) that force disables libstdc++ allocation pools via the above environm...