This page is READ-ONLY. It is generated from the old site.
All timestamps are relative to 2013 (when this page is generated).
If you are looking for TeX support, please go to

linux ? why linux?

i can't love u anymore :)
Added by about 3 years ago  »  Votes: 1/1

I have a directory /p/ which contains 17 722 files and I want to show its files in the xterm's screen.

Because of a large amount of files, I expected that my Linux box would show a good performance. And below what I got.

On an Ubuntu 9.04 server, the first use of ls took 4 minutes to list all files. (During the execution of ls, the system wasnot busy (CPU ), and the amount of free RAM was more than 1GB.)

$ time ls /p/
real    4m41.652s
user    0m0.190s
sys     0m1.210s

Here's the second use:

$ time ls /p/
real    0m2.340s
user    0m0.180s
sys     0m0.200s

It seems that something was cached, so the ls ran quickly.

Then I gave a try on a FreeBSD box (/p/ with the same contents). The result was amazing:

$ time ls /p/
real    0m1.128s
user    0m0.224s
sys     0m0.105s

That's the first use of ls. The second one gave a similar result.

Why Linux?


Added by pclouds about 3 years ago

On what filesystem?

Added by about 3 years ago

They're ext3 on Linux and ufs on FreeBSD. I used the default setting provided by installers.

The filesystem needs tuning?

Added by bronzeboyvn about 3 years ago

không chỉ với ls, thử với find cũng thế. Mình tìm một số files trong 1 thư mục cố định, lần đầu chạy luôn chậm nhất!

Added by about 3 years ago

Ồ, cái này lạ nghe. Phải tìm hiểu thêm thử tại sao! Rất có ích khi phát triển các hệ thống lớn và vấn đề speed up ứng dụng.