This post is a techy one, so if you don’t write AIR apps or if you think this wouldn’t be enough to show off dur­ing cof­fee break I rec­om­mend some­thing fun­nier.

Work­ing on a big fat AIR app (more than 400 Mb) I noticed some­thing quite strange: using Encrypt­ed­Lo­cal­Store get/setItem meth­ods hap­pened to be slow, I mean very slow, but like, slow as hell (like 5 to 10 sec­onds per call) but only after launch­ing the app, and not after. Some­thing that I never noticed before ; nei­ther with other AIR apps, nor for this one before I added its heavy con­tent… And the tricky part is that it only occurred with a com­piled app, but not within ADL.

I googled a bit and found this thread which is mainly about the strongly­Bound para­me­ter for setItem, but its last post by Oliver Gold­man rang my bell:

The first time ELS is accessed the application’s sig­na­ture needs to be ver­i­fied, regard­less of whether or not strongly­Bound is set. If strongly­Bound is set, then the sig­na­ture is re-verified as the appli­ca­tion is run­ning. Either way, it’s expen­sive if you have a big application.

Small app: fast, fat app: slow as hell. Les­son learned…

And this is true both for Flash and HTML/JS AIR apps. So if you don’t need your data to be encrypted I highly rec­om­mend using Share­dOb­ject (or else) instead. As far as I’m con­cerned the first calls dropped from 5/10 sec­onds to a few milliseconds.

Bingo.