Tuesday, July 04, 2006

Today in performance

I started off today by using massif and the traditional memcheck to see where memory was allocated in the libgnomeui stack

  • We use libgnutls to handle ssl in gnome-vfs. This program mallocs 65 kb of memory in the intializer (which is called from gnome-vfs's initializer). I sent off an email to the address their website told me to use for bugs (no bugzilla!). If you are interested in fixing this on the gnutls side, the code to look at is gnutls_global_init, specifically the two calls to asn1_array2tree. In the mean time, I think we should fix this in GNOME by lazily initializing the tls library. I think this is a pretty rare use case. On my (basically empty) desktop, 18 processes are using gnome-vfs. That makes 1.1 MB (probably more, countin malloc overhead).
  • Noticed lots of allocations from inside glibc when calling setlocale (which the gnome option parser does). Turns out there is a glibc cache for this stuff, but Ubuntu wasn't packaging it. Filed a bug. I have 40 processes using the cache right now (even bash uses it!). Not using the cache costs about 70kb. That's 2.7 mb.

I then went on to look a bit at gedit, which I noticed was taking up a pretty high amount of memory

  • First sign of trouble: gedit loads python. Why? By default a plugin called "modelines" which describes itself as "Emacs, Kate and Vim-style modelines support for gedit". I'm not sure exactly what that does, or how I'd use it. Disabling just that plugin gives me back 3.2 mb of ram. It also made gedit feel faster to start up. Filed a bug suggesting that it either be disabled or written in C.

    It looks like python+gtk could use some memory optimization. For startup, a hello world in Python has 4 mb of private dirty rss. Compare this to Mono and Gtk# which takes only 2.7 mb. Granted, even Mono is large compared to 608 kb for a C based GTK app. I'll see what I can do about that some weekend :-).

  • Ubuntu's launchpad-integration library was taking up quite a bit of memory by allocating pixbufs. strace -eopen gave the issue away:

    open("/usr/share/pixmaps/lpi-help.png", O_RDONLY|O_LARGEFILE) = 17
    open("/usr/share/pixmaps/lpi-translate.png", O_RDONLY|O_LARGEFILE) = 17
    open("/usr/share/pixmaps/lpi-help.png", O_RDONLY|O_LARGEFILE) = 17
    open("/usr/share/pixmaps/lpi-translate.png", O_RDONLY|O_LARGEFILE) = 17
    ... (78 lines of this)

    Whoops :-). Filed a bug. Not sure how much this saves, as it's not easy to count how many times this code is used.

So, that's about 7 mb of memory from all these issues (and my estimates are fairly conservative -- I'm rounding things down, not counting malloc overhead, and looking at my desktop with just xchat, gaim, firefox, gedit, and a few terminals), I'd actually expect the total effects of these to be 8-10 mb. Even with 1 gb of ram, that's pretty large.


Anonymous said...

Great work.

But you know that guy is going to come back and post a comment "what, only 10 MB? who cares?". :-)

Anonymous said...

Good Job!

One MB at a time, one day GNOME will be usable by people with machines with only 64 MB on RAM (well, at least if some care is put in selecting what applications to install: for instance Epiphany instead of Firefox and GNOME Office instead of Open Office et cetera..)


Anonymous said...

GNOME today works pretty well with 256 MB, but it's not as good with only 128 MB. A saving of about 8 MB, corresponds to more than 6% memory on a 128 MB machine!

Again, good job (and keep it going)!

Jon Cooper said...

10mb.... is this turning into a competition between you and Frederico...?! :)

Top work, I suspect with a larger app usage (surely nautilus itself, along with evolution benefits?) top work like this will bring that dirty mem usage down!

I think Eugenia of osnews fame blogged about gnome on a sub 128mb machine recently... using Arch.

Anonymous said...

I imagine the modelines thing parses the

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

line at the top of files to tell emacs what values to use. Probably useful for a programmer, but umm, 3 meg for it is a bit overkill.

Anonymous said...

It might be nice if you explained how you were doing all this with more than just "I used massif" for other people to get involved as well


Anonymous said...

Really great work. Many people appreciate this kind of stuff.

Anonymous said...

You're right, Iain!

Ben, can you explain your methodology to get your stats?

I will happy to join the monkey dance!


Anonymous said...

Love your work! Please keep with this. Making Gnome useable on older systems will go a long way toward reducing the amount of computers dumped each year.

All of the computers dumped annually in the USA alone makes a 22 storey high pile covering the entire 472 square miles of Los Angeles - see http://www.treehugger.com/files/2006/06/china_mexico_an_1.php

Therefore, performance work is probably one of the most important areas and something I wish I had the experience to take on myself. I will start slowly, first teaching myself C.

Anonymous said...

Great Work Ben!!!
Go ahead!!! Could you explain a little bit more how you are doing all ?

Anonymous said...

Anonymous: That article says "over the next few years", not "annually". I'm as sensitive as the next guy about conservation, but even over many years, that number is hard to believe.

22 storeys is about 220 feet. 427 mi^2 x 220 feet = 82.0 Gm^3, or (assuming 300M people in the US) 273 cubic meters of computer junk for every man, woman, and child in the country.

I find that a bit hard to believe. I'm the most computer-geeky person in my family, and all the computers I've bought in my life don't make up even one cubic meter. Maybe business computers make up most of it, but even all the computers I've used at every job I've had don't make up one cubic meter.

Another way to look at that number: stacked one storey high (10 ft), it equals 965 ft^2 per capita. I've never lived in an apartment that big! Does somebody think that every man/woman/child fills a medium-large apartment, floor to ceiling, including the bathroom, with computer hardware, and throws it out regularly?

That number sounds about 2 orders of magnitude too large. Even covering LA 2 feet deep is a lot of junk, though sometimes I wonder if anybody would notice.

Anonymous said...

代孕 淘宝刷信用
北京发票 代开发票
餐饮发票 住宿发票
广告发票 对讲机
传世私服 传奇世界私服
新开传世私服 传奇私服
天龙八部私服 天龙私服
手机窃听器 手机窃听器
代写论文 代写论文
北京办证 办证
代孕 代孕网
代孕 代孕
代孕 试管婴儿
代写论文 代写论文
代写代发 论文代写 dhl

modern abstract art sofa manufacturer
净水器 开水器 净水机 净水 软水机 软水 直饮机 家用净水 家用净水器 家用净水机 中央净水 中央净水器 水家装 水家电 水卫士 混合机
过滤机 DHL快递 俄罗斯签证
保险箱 法兰 法兰标准
polycarbonate sheet 回流焊 波峰焊
免烧砖机 注册上海公司 儿童摄影
牛皮癣 皮肤病 制氮机
食堂售餐机 校园一卡通
学校一卡通 ic卡售饭机
食堂售饭机 深圳一卡通
广东售饭机 机电设备安装
北京发票 代开发票
餐饮发票 住宿发票
网络电话 免费网络电话
假发 补发
织发 植发
压滤机 板框压滤机
蒸馏水机 纯蒸气发生器
上海搬家公司 上海搬场公司
大众搬家 大众搬场
张家界旅游 香港旅游
深圳旅行社 打包机
收缩机 对讲机 电源模块
售饭机 水控机 水控器
萎缩性胃炎 neoprene laptop bags
SEO优化 计量泵
胃炎 胃病
冷水机 冰水机
北京特价机票 北京打折计票 北京国际机票
北京机票预定 北京飞机票
北京订机票 北京机票查询 饮料机械
血糖仪 血糖仪
银杏 水培花卉 企业宣传片 空分设备
化工泵 离心机
电话交换机 程控交换机 集团电话 集装袋
混合机 混合机
混合机捏合机 捏合机
捏合机导热油炉 导热油炉
导热油炉 反应釜 反应釜
反应釜 spherical roller bearing
搬运车 搬运车 电动搬运车 油桶搬运车 堆高车 电动堆高车 半电动堆高车 堆垛车
高空作业平台车 电动叉车 平衡重叉车 前移叉车 电瓶叉车
韩国饰品批发 模块电源
X架 超薄灯箱> 易拉宝 展柜制作
代理服务器 游戏加速器 网络加速器
网通加速器 电信加速器 电信网通转换器
电信网通加速器 网通电信互转
网通电信互通 网络游戏加速器
美国VPN代理 美国独享VPN 美国独享IP
pvc ceiling panel Spherical roller bearings
安全鞋 劳保鞋 防砸鞋 电绝缘鞋 上海安全鞋 上海劳保鞋 江苏劳保鞋
服装软件 服装管理软件 进销存软件
进销存管理软件 服装管理系统 服装进销存软件
进销存系统 进销存管理系统 免费进销存软件
吉林中医 东北特产
阳痿 阴茎短小 阴茎增大
早泄 前列腺炎 阴茎增粗 阴茎延长
国际机票 上海国际机票
国际特价机票 国际打折机票
CRM 客户管理软件 客户关系管理
免费客户管理软件 客户管理软件下载 客户信息管理系统 销售管理系统 销售管理
CRM系统 CRM软件 客户关系管理系统
客户关系管理软件 客户管理 客户管理系统 营销管理系统 客户资源管理 销售管理软件 客户资料管理软件 客户资源管理软件
客户信息管理软件 客户资料管理 客户资源管理 客户信息管理 客户资料管理系统
客户资源管理系统 客户管理软件免费版
砂磨机 砂磨机
砂磨机 卧式砂磨机
卧式砂磨机 卧式砂磨机
三辊研磨机 三辊研磨机
三辊研磨机 混合机 混合机
混合机 锥形混合机 锥形混合机 锥形混合机 行星动力混合机 行星动力混合机 行星动力混合机 无重力混合机 无重力混合机 无重力混合机
干粉砂浆设备 干粉砂浆设备
干粉砂浆设备 捏合机 捏合机 捏合机 导热油炉 导热油炉 导热油炉 反应釜 反应釜 反应釜 搪玻璃反应釜 搪玻璃反应釜 搪玻璃反应釜
乳化机 涂料设备 干混砂浆设备 无重力混合机 胶体磨 涂料成套设备 双螺旋混合机
北京婚庆 北京婚庆公司
办证 呼吸机 制氧机
亚都 亚都加湿器 亚都净化器
饰品批发 小饰品批发 韩国饰品 韩国饰品批发 premature ejaculation penis enlargement
破碎机 制砂机 球磨机 雷蒙磨 雷蒙磨粉机 鄂式破碎机 鄂式破碎机 免烧砖机 加气混凝土设备
反击式破碎机 选矿设备
安利产品 马来西亚留学
网站优化 网站推广
论文代写 代写论文
拖链 防护罩 排屑机 塑料拖链 钢铝拖链
深圳装饰 深圳装饰公司 深圳装修公司
特价机票 打折机票 国际机票
新风换气机 换气机 立式新风换气机 风机箱 新风系统 能量回收机
搅拌机 混合机 乳化机
毛刷 毛刷辊 工业毛刷 刷子 钢丝刷
涂层测厚仪 硬度计
兆欧表 激光测距仪
测振仪 转速表
温湿度计 风速仪
噪音计 红外测温仪
硬度计 万用表
美容院 美容加盟
澳洲留学 澳大利亚留学
酒店预定 北京酒店预定 北京酒店
nail equipment nail products nail product nail uv lamp nail uv lamp nail uv lamps uv nail lamp nail brush
nail file nail tool nail tip nail gel curing uv lamps lights
万用表 风速仪
红外测温仪 噪音计
苗木价格 苗木信息 标牌制作 深圳标牌 北京儿童摄影 防静电鞋 淘宝刷信誉
威海凤凰湖 威海海景房 大庆密封件
打标机 淘宝刷信誉 TESOL/TEFL国际英语教师证书 英语教师进修及培训 北京快递公司 北京国际快递