Development

共370篇文章。

OpenJDK on FreeBSD

Development

Maho今天正式commit了OpenJDK的port,表面上看这是一小步,但在我看来这却是一项历史性的进步,因为终于可以不再受到之前那个click-through许可证的限制了(也就是说,可以几乎没有任何限制地随光盘,或者通过网站提供可用的jdk源代码和二进制版本了)。

与此同时,继续期待Apache Harmony的FreeBSD port,有没有人有兴趣搞一下?

参与评论:OpenJDK on FreeBSD

memchr(3) rewrite

Development

I have taken some time to rewrite memchr(3) to utilize a similar algorithm to my strlen(3). Two different formulas, however, would have roughly a 1/3 difference.

Currently I have taken an approach where, when memchr(3) tries to match an 8-bit pattern, it treats the string as 8-bit using the first formula, which is expected to have uniform O(n)O(n) time complexity by reducing unnecessary branches.

This approach, however, might be bogus: if you look for a 7-bit character within an 8-bit string, memchr(3) will perform poorly when there are many characters with their MSB set to 1.

阅读全文…:memchr(3) rewrite(本文约109字,阅读大致需要1分钟)

GCC运行环境豁免条款再次狠狠地打了苹果的耳光

Development

今年1月27日发表的《GCC运行环境豁免条款 (英文版)》再次狠狠地打了苹果的耳光。

原先的豁免条款如下:

// As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License.

阅读全文…:GCC运行环境豁免条款再次狠狠地打了苹果的耳光(本文约600字,阅读大致需要2分钟)

Progress on LLVM clang

Development

As some of you already know, FreeBSD, along with some other Open Source projects, is moving away from GCC due to GPLv3. From a technology perspective, this also makes sense since the (likely) candidate, BSD-style licensed, LLVM based clang, a C compiler, is making reasonably good progress.

So, what should we expect from LLVM or clang?

Here is a good comparison between GCC and clang. Despite GCC is popular, considerably more mature,and supports more languages (especially C++, which clang’s support is incomplete at this moment), clang provides cleaner AST (Abstract Syntax Tree), much more modularized (if you take a look at GCC’s history,Richard Stallman intentionally made GCC’s code not reusable in other software), provided much more information for optimizer, is much faster and use much less memory, etc.

For FreeBSD, currently, clang can compile its kernel with only very few tweaks.

阅读全文…:Progress on LLVM clang(本文约307字,阅读大致需要2分钟)

New strlen(3) committed

Development

Finally, I got my strlen(3) [1] committed against -HEAD. This is a long story, to put it short, I had proposed assembly version of some string operations at the point of 2005, but these was never committed due to a hard disk failure, and as Bruce pointed out, having the hand optimized assembly code use a different algorithm is not good in general.

Therefore, I have take some time on it and reimplemented the idea in C,resulting in a portable (say, you can use it on any 32-bit or 64-bit processors, and it can be easily extended to 128-bit) version.

So, is it important for *YOU*?

Generally speaking, it should not. Performance sensitive programs should, by all means, avoid C style string operations. Think a 5x better strlen(3) would boost performance of your application since it uses strlen(3) in critical path? Think again!

However, I found it valuable. There is difference in worldstone, where I saw some minor improvements. Micro-benchmark indicates that this version is at most 2x slower when the string is very short, but 5x faster for strings that is at least word-length long.

[1] Note: the version has been further revised to provide better comment and match style(9).

阅读全文…:New strlen(3) committed(本文约292字,阅读大致需要2分钟)

7.1-RELEASE升级流量冲击导致portsnap服务同步受阻

Development

许多老派的FreeBSD用户喜欢用源代码方式升级。运行了十多年的基于cvsup的同步机制由于有很多镜像支持因此一直没有遇到太大的问题,但是FreeBSD 6.1开始引入的freebsd-update提供了新的以二进制形式更新系统的方法,最近几年FreeBSD内核的许多改进已经使编译自定义的内核不再像以前那样重要了。

阅读全文…:7.1-RELEASE升级流量冲击导致portsnap服务同步受阻(本文约314字,阅读大致需要1分钟)
搜索文章…(按ESC退出)