Performance

共105篇文章。

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).

阅读全文…(本文约292字,阅读大致需要2分钟)

关于大量静态页的想法

• Development

上次在MeetBSD的时候Tim提到了一种处理大量静态页的办法。今天看Squid开发人员在NYC的BSD活动上的一个演讲里面也介绍了各种方法处理I/O的区别。

阅读全文…(本文约238字,阅读大致需要1分钟)

MeetBSD 2008 (1)

• Development

今天起了一个大早,9:00到了位于1600 Amphitheatre Parkway的Google总部。

手头没有精确的人数统计,不过目测来看,大概有120–150人。看到的第一个见过照片的人是著名的Cameraman同学,DragonFly的Matthew Dillon老大!

由于今年是FreeBSD计划成立15周年,今年的MeetBSD ‘08 California很大程度上是一次FreeBSD的活动。

阅读全文…(本文约1718字,阅读大致需要4分钟)

抢占式调度

• Kernel

现代操作系统中,抢占式调度是一个很有意思的话题。

教科书对于抢占式调度的定义比较简单—-抢占式调度中,任务切换动作可以由于优先级变化而触发,而并非仅限于时间片用完或主动放弃CPU(当然,一般而言我们并不认为中断处理是一次严格意义上的抢占操作)。

从直觉上看,抢占式调度必然增加潜在的上下文切换次数,并因为增加了这些开销而降低系统吞吐量。那么,为什么要引入抢占式调度呢?

阅读全文…(本文约541字,阅读大致需要2分钟)

YSlow

• Development

An elegant tool for analysis of your website regarding its appearance slowness. Why is it slow?

What you need are:

  • Firefox browser;
  • The “Firebug” plugin'
  • “YSlow” plugin from Yahoo.
参与评论

patched top(1) and kernel to support multiple CPU

• Development

前几天有人问FreeBSD的top(1)如何能够显示不同CPU的占用情况。这是patch过之后的输出:

FreeBSD 8中已经包含了这个功能。

参与评论

BSD ar(1) announced

• Development

Kai Wang has announced today the BSD ar(1) is available for wider testing. This is amazing work, the creation and list speed are 5-20 times faster than GNU ar(1),and extraction speed is also slightly better than GNU ar(1).

It is also important to note that this version is completely BSD-licensed (yes, that means that you are free from the lair’s license), and is a piece of the vital parts of the FreeBSD DTrace work.

参与评论

使用 固态盘(SSD)来改善本地存储的性能?

• Kernel

最近看到OpenSolaris上面的ZFS引入了将ZIL写到另一个pool的方法。这种做法非常类似于FreeBSD 2005年的Google SoC项目—-GEOM Journal。

简单地说,这种做法的原理就是将准备写的数据(注意,不是元数据,而是数据)首先写到固态盘上,然后再将数据写回。这样做有很重要的好处,即先前必须同步写入的数据(例如fsync()、文件系统元数据更新等等),可以不必做完整的回写,而只需将SSD作为回写快取缓存 (Write-Back Cache) 了。

阅读全文…(本文约391字,阅读大致需要1分钟)