|
|
发表于 2005-10-12 17:37:13
|
显示全部楼层
Post by jhuangjiahua
怎么个绝对法 ?
f-spot 是相册
第一次使用需要花时间建立图片索引
这句话说出了问题的本质。
Solomon:~/.gnome2/f-spot# ls -lh
总用量 40K
-rw-r--r-- 1 root root 37K 2005-10-12 17:11 photos.db
Solomon:~/.gnome2/f-spot#
可以看到,f-spot之所以比其它的软件运行速度快,准确的说是感觉它运行速度快,是因为它建立了索引。
其实,更准确的说,不是建立索引,而是干脆建立预览图片库。
预览图片比较小,可以放到内存里面缓存,省掉了文件读写操作,而其它看图软件则是每次重新读取预览图片,速度当然慢。
至于查看完整图片,由GTK/GNOME提供的控件来实现,大家速度是基本相同的。
结论是,f-spot的浏览速度快,是因为算法的改进,和mono没关系。如果用java+swt,效果不见得比它糟糕。
这种算法应用于图片库比较合适,但是如果只是用来看漫画,就没什么优势了。
对于我这种老家伙,由于以前没有这样算法的工具,已经习惯了看file list,所以算法的优势发挥不出来,反而多占了30M内存。
Solomon:~# psx | grep spot
28291 pts/16 S+ 0:00 0 611 5264 1296 0.1 | | \_ /bin/sh /usr/bin/f-spot
28292 pts/16 Sl+ 0:03 0 1429 62010 28012 3.0 | | \_ mono /usr/lib/f-spot/f-spot.exe
Solomon:~#
刚要提交上面的文字,结果。。。
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
in <0x001d9> TagView:OnExposeEvent (Gdk.EventExpose args)
in <0x00054> Gtk.Widget:exposeevent_cb (IntPtr widget, IntPtr evnt)
in (wrapper native-to-managed) Gtk.Widget:exposeevent_cb (intptr,intptr)
in <0x00000> <unknown method>
in (wrapper managed-to-native) Gtk.Application:gtk_main ()
in <0x00007> Gtk.Application:Run ()
in <0x00007> Gnome.Program:Run ()
in <0x003ca> Driver:Main (System.String[] args) |
|