Wednesday, April 23, 2008

Magic Trick

Magic trick for Kubuntu users:

1. Make an empty new directory ~/.compose-cache
2. Start a KDE application which has a text input widget (anything with a line edit or editable combo box will do)
3. Check ~/.compose-cache, it should now have a file in it whoose name is a long string of numbers

All being well, your Qt/KDE/Gtk applications should now start up 50-150ms faster.

Users of other distros are welcome to give it a try, I have only been able to test directly on Kubuntu. If you have a non-empty /var/cache/libx11/compose folder (eg. SuSE users) then this optimization is already enabled so you don't need to do anything.

For those curious about what is going on here, this enables an optimization which Lubos (of general KDE speediness fame) came up with some time ago and was then rewritten and integrated into libx11. Ordinarily on startup applications read input method information from /usr/share/X11/locale/<your locale>/Compose. This Compose file is quite long (>5000 lines for the en_US.UTF-8 one) and takes some time to process. libX11 can create a cache of the parsed information which is much quicker to read subsequently, but it will only re-use an existing cache in /var/cache/libx11/compose or create a new one in ~/.compose-cache if the directory already exists.

Relevant freedesktop.org bug report

23 comments:

Jonathan Thomas said...

Neat trick. It's magically delicious!

Anonymous said...

I filed a bug at https://bugs.edge.launchpad.net/ubuntu/+source/libx11/+bug/221065.

Jakob Sack said...

Works on Mandriva 2008.1, too :-)
Thx

Anonymous said...

Sounds like voodoo but it works (of course on GNOME too when you open a KDE-App)

taki said...

On Suse 10.3 /var/cache/libx11/compose allready exists, so I can assume this nice feature is allready in use here :-)

Mick T. said...

Thanks for the tip. :)

Mick

Anonymous said...

Neat!

Sudipta Das said...

Hi people, I love magic very much. What is a good street magic book that doesn't require gimmicks? I found a website link but I am not sure if I should trust Master Mentalist or not, because it looks somewhat fake. Does anyone know of a good magic book that enables me to do tricks unexpectedly without having a gimmick set up? Thanks a lot for any helpful comments.

sudipta das
____________
magic card tricks

Galbi said...

Worked fine in Tuquito 2.0r5 (Debian based Argentinian distro)

Thanks.

Anonymous said...

[URL=http://www.uggbootsdirect.com]ugg boots[/URL]It had been [URL=http://www.uggbootsdirect.com/]uggs[/URL]an excellent [URL=http://www.ismachines.com]High pressure blower[/URL]pregnancy, without medical[URL=http://www.ismachines.com]Industrial fan[/URL] restrictions.[URL=http://www.ismachines.com]Industrial blower[/URL] Even so,[URL=http://www.ismachines.com]Commercial blower[/URL] he had not been [URL=http://www.downtownkey.com/]wholesale[/URL]able to make love [URL=http://www.downtownkey.com/]china wholesale[/URL]to her for [URL=http://www.downtownkey.com/]wholesale shoes[/URL]several months. [URL=http://www.downtownkey.com/]wholesale clothing[/URL]He found himself wanting [URL=http://www.accessasl.com/]watches[/URL]to protect her instead, to carry her up[URL=http://www.ismachines.com]pressure blower[/URL] flights of stairs, [URL=http://www.ismachines.com]pressure blowers[/URL]to wrap her in blankets,[URL=http://www.ismachines.com]fans[/URL] to bring her cups of custard. [URL=http://www.ismachines.com]blowers[/URL]"I'm not an invalid," she protested each time, laughing. "I'm not some fledgling you discovered on the lawn."

Anonymous said...

ugg bootsOutside,uggs snow continuedHigh pressure blower to fall quietly throughIndustrial fan the darkness, Industrial bloweras bright and thick Commercial bloweras static in the wholesalecones of light castchina wholesale by the streetlights.wholesale shoes By the time he rosewholesale clothing and looked out watchesthe window, pressure blowertheir car had become a soft white hill on the edge pressure blowersof the street.fans Already his footprints blowers
in the driveway had filled and disappeared.

Anonymous said...

wholesaleShe looked up, wholesale atvsmiling, wedding dresseswhen he tuckedMP3 player
the blanketwholesale mp3 around her legs.Wholesale Mp4
"You know,digital camera wholesale I've been wondering consumer electronicswhat it's like,"mp5 player she said. memory cards"Before we're born,Car video players I mean. It's too bad we can't remember." gps devicesShe opened her robe and pulled up the bluetooth headsetsweater she wore underneath, revealing a Mp3 Wholesalebelly as round and hard asMp3 Wholesale a melon. Mp4 WholesaleShe ran her hand across its smooth surface, Mp4 Wholesalefirelight playing across her skin, casting reddish gold onto her hair.

Anonymous said...

ugg bootsOutside,uggs snow continuedHigh pressure blower to fall quietly throughIndustrial fan the darkness, Industrial bloweras bright and thick Commercial bloweras static in the wholesalecones of light castchina wholesale by the streetlights.wholesale shoes By the time he rosewholesale clothing and looked out watchesthe window, pressure blowertheir car had become a soft white hill on the edge pressure blowersof the street.fans Already his footprints blowers
in the driveway had filled and disappeared.

Anonymous said...

The Nets wow goldwent 9-7 in October and November, wow goldand they went 6-10 in January. wow goldThe falloff offensively haswow gold outweighed the improvementwow gold defensively. But we see wow goldnow that the fast start was a bit of a mirage.

Anonymous said...

There aredofus kamas three teams that appearkamas dofus twice above. The Thunderdofus kamas are on the right end of kamas dofusboth lists. They'veacheter dofus improved bothbuy kamas offensively and defensively, acheter kamasthanks in part to how horrible they were early in the season. They had nowhere to go but up.

Anonymous said...

These areworld of warcraft gold relatively smallcheap wow gold sample sizes, wow orand factors otherwow power leveling than how world of warcraft goldwell the wow poteam is playing (injuries, schedule)wow orhave certainly buy wow goldhad an effect. But the Nets'cheap wow gold improvementwow power leveling on the wow powerlevelingdefensive end dofus kamasisn't too hard tokamas dofus explain. They had a lot of roster turnover and Lord of the Rings Online Goldhave several LOTRO Goldyoung players, LOTR Goldincluding two rookies, flyff moneyin their rotation.flyff penyaSo, as their team buy flyff goldhas grown together ffxi giland their young buy ffxi gilguys have Final Fantasy XI giladjusted to the buy Warhammer goldspeed of theWarhammer gold game, they've improved defensively.EverQuest 2 gold"Experience is a eq2 platlot of it," says rookie Ryan Anderson, who has started the last 12 games in the absence of Yi Jianlian. "I know I've improved a ton defensively this season."

Anonymous said...

Anderson [pictured wow goldabove against Boston's wow goldEddie House] matched up with Charlie wow goldVillanueva in the Nets' win overwow gold the Bucks onwow gold Tuesday. Villanueva had wow goldaveraged 27 points in his previous three games, but scored just 11 on Tuesday on 5-for-15 shooting.On the season, the Nets still are one of the four worst defensive teams in the league.

Anonymous said...

It could be that wow gold farmingmarks wow gold guidethe sell wow goldfirst wow gold pricesWheatieswow gold hacks appearance forwow gold guides Reed. cheap wow gold euOther wow gold gameWheaties make wow goldBlack wow gold shopHistory wow europe goldMonthwow fishinghonorees wow gold tradehave wow gold makingincluded wow gold onlineMuhammad Ali, wow hacksHank paladin wowAaron,paladin wow Jackie gold in wowRobinson, wow druidJosh wow gold mmoGibson, wow warlockSatchellwow gold tips Paige, wow free goldJames wow gold farming"Cool Papa" wow gold usBell, wow instant goldAlthea Gibson,wow map Arthur gold seller wowAshe, to wow goldWalter very cheap wow goldPayton, wow 1000 goldBill wow addonsRussell wow gold sellerand wow goldsJulius buy gold for wow"Dr. wow eu gold" Erving.wow europe The wow forumsnewwow gold exchange 15.6-ounce wow gold fastWheaties wow gold paypalpackage wow guidesis cheap gold for wownow selling wow goldavailablewow gold guide nationwide.Thewow gold price NBA, wow gold sellingfoundedwow private server in best wow gold1946, isgold on wowa globalof wow gold sports wow characterandwow gold on entertainmentwow gold and brand how to wowthatwow gold for sale features wow patch30buy cheap wow gold teams buy wow gold cheapin buying wow goldthe Unitedwow cd key Stateswow gold sale and buy wow accountsCanada. During gold for wowthe wow farming2008-09wow gold for season, wow guideNBA games sell wow goldwill reach guild wars gold215 countries cheapest gold wowand cheapest wow goldterritories wow accountin 41 wow accountslanguages. Thewow pvp It could be that Devin Harris was playing a little over his head earlier in the season. He shot 49 percent in the first month and 39 percent in January.

MagicShops said...

Nice trick! I'm a fan of magic trick, I spend a lot of time watching them on DVDs that I buy from magic shops!

costa rica hotels said...

hi guys ... I was very pleased to read the information in this article ... was of great interest and would love to get a lot more information about "Magic Trick"

Lots in Costa Rica said...

Hello I want to congratulate to them by its site of the Web of the excellent looks like entertained and very good very to me it elaborated. I invite them to that they explore a little on my Web site. Lots in Costa Rica Costa Rica Cheap Land for Sale

www.sofas.nom.es said...

This will not have effect in fact, that's exactly what I suppose.

Anonymous said...

Thanks for the trick.
Is it works with other desktop environments, like lxde?