Examining Python's string concatenation optimization

In the comments on the other day's' minimizing object churn ' entry, it wasnoted that Python string concatenation had been optimized some in therecent 2.4 release of the CPython interpreter. The 2.4 release notessay (from here ):

  • String concatenations in statements of the form s = s + "abc" and s += "abc" are now performed more efficiently in certaincircumstances.

But what is 'more efficiently' and what are the 'certaincircumstances'? What does it


偽善.philosophical

prince.
You are the little prince.

Saint Exupery's 'The Little Prince' Quiz.
brought to you by Quizilla


竟然係咁。可惡。最憎做主角。philosophical你個頭,最後個條唔揀「You are more powerful than the finger of a king」,而偽善地揀了「What is essential is invisible to the eye」,背叛了精神分析的現實觀,仲搞到philosophical添。自食其果食

Weekly spam summary on November 5th, 2005

This week we received 12,872 email messages from 229 different IPaddresses. Our SMTP server handled 22,584 sessions from 1,544different IP addresses, which is significantly down from last week .

To go with it, overall connections are down a lot from last week : we only saw 93,950 connections from at least 31,000different IP addresses. I believe this is the lowest connection rateI've seen since


.....

潘志雄暫時因工作而死了
raidoblog也死埋
不過...
12月之後會重生
密切留意
謝謝關心

Minimizing object churn to optimize Python code

One of the interesting things about writing code in high level garbagecollected languages is how your optimization concerns can change. Oneoptimization in all GC'd languages, Python included, is minimizing thecreation of new objects and maximizing the reuse of old ones; thefewer new objects you create, the fewer cycles garbage collectioneats, the less memory gets fragmented, and you often even use lessmemory overall.

Minimizing object churn is behind several well-known Python(anti-)patterns, such as 'avoid repeated string


20051105網摘 – 微軟大動作

MS


聶魯達詩見comment

聶魯達詩歌朗誦會(Poetry reading:The works of Neruda)
為慶祝諾貝爾文學獎得主聶魯達誕辰101年及響應《情迷拉丁》文化節,由紫羅蘭書局主辦《聶魯達詩歌朗誦會》,誠邀本港詩人包括:鍾國強、杜家祁、陳智德、艾歌(結他伴奏)、葉

《親切的金子》:餘數或者細節

她(印度的毀滅女神迦梨)通常被繪制成一個可怕的、美杜莎似的實體,擁有無數隻手足,擺出進攻性姿勢——然而,正如每一個印度人所知道的,關鍵在於,在這些手足中隱藏著某種元信息(meta-message),一隻小手以撫慰的姿態
Continue reading...

練習之咁都算更新

我的錢包碩大無朋,別人都以為是記事簿,或者聖經——大概因此它從沒被偷去。我則說它像個枕頭。

它算是名牌貨,減價時買才60塊。仿緞的布面本是亮紅色的混金線,本身就帶點古意;因久經磨損而褪色發黃,這種古意其

Modifying Linux kernel configuration options the easy way

Modifying a Linux kernel configuration option can be an annoyingexperience, as you poke around the menus of ' make menuconfig ' tryingto find where the configuration option you want to change is hiding.Fortunately there's a less well known but much easier way.

The kernel build process stores configuration settings in the file .config in the root of the kernel source tree. However, it generatesother things from the file (and some options are interdependent), so youcan't just edit the file and go;