产品
  服务
 

 

      在嵌入式系统中一般储存设备的容量比较小,为了尽可能多地存放资料,需要一个类似Microsoft的double space 的功能,我们提供了一个压缩文件系统的方案。其基本思想是在操作系统的文件系统和块设备(block device)之间加了一个压缩驱动层,实现数据的压缩。使用了这个方案之后系统的整体速度下降不会超过5%,因为现代操作系统中有较强的cache功能。这个系统的特点是和具体的文件系统基本无关,因此有极强的通用性。我们已经成功地在Linux和Xipos中实现了这个功能。

 

以下是CompactFs和jffs2的比较
compact fs
jffs2
注释
压缩率
一致
都是用gzip算法
读写文件的性能
compact fs 略好于 jffs2
jffs2在每次write file时都会做压 缩的动作,而compactfs则只 是在file system的cache真正写进flash时 才做压缩,所以平均起来compactfs会比 jffs2快
mount速度
是否有考虑 flash rom的特点
flash rom 需要均匀地使用所有的block
错误恢复
用fschk完成
在mount时完成
这也是jffs2 mount起来慢的原因
移植性
jffs2 和linux结合得很紧
可否查看某一文件的压缩率
可以
可否指定某一文件不可压缩
可以
不可以

 

以下是对各种文件进行压缩得到的数据
类别
原来大小
压缩后大小
压缩率
text
22M
5M
22.7%
24bit bmp
480K
195K
40.6%
exe
1M
0.3M
33%

 

  以下是用流行的Linux下的测试工具的测试结果 CPU 55MHz MIPS Samsung NAND Flash

    # iozone IOZONE:
Performance Test of Sequential File I/O -- V2.01 (10/21/94) By Bill Norcott
Operating System: POSIX 1003.1-1990
Usage: iozone [megabytes] [record_length_in_bytes] [[path]filename]
iozone auto[=filename]
iozone raw[=filename]
iozone cdrom[=filename]
iozone help
Send comments to: b_norcott@xway.com
IOZONE writes a 1 Megabyte sequential file consisting of 2048 records which are each 512 bytes in length. It then reads the file. It prints the bytes-per-second rate at which the computer can read and write files.
Writing the 1 Megabyte file, 'iozone.tmp'...1.670000 seconds
Reading the file...0.550000 seconds
IOZONE performance measurements:
627889 bytes/second for writing the file
1906501 bytes/second for reading the file

     # bonnie
File './Bonnie.28', size: 1048576
Writing with putc()...done
Rewriting...done
Writing intelligently...done
Reading with getc()...done
Reading intelligently...done
Seeker 1...Seeker 3...Seeker 2...start 'em...
done...
done...
done...
-------Sequential Output-------- ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
1 188 48.5 431 35.8 290 28.4 414 100.0 6077 100.9 326.7 589
    #