On Mon, Dec 13, 2010 at 10:08 AM, Les Hazlewood <[email protected]> wrote: > On Sun, Dec 12, 2010 at 6:16 AM, Janne Jalkanen <[email protected]> > wrote: >> 3) I wrote my own Serializer, and this was the whopper: just by simply >> serializing nothing but the UUID (with the appropriate magic numbers), I was >> able to squeeze the cookie size from 700 bytes to 74 bytes (!) while >> encryption was on. This is a good result, and should also make my website a >> bit snappier since there is no longer a need to transfer huge cookies. This >> suggests that the default HashMap serialization *is* actually a lot of >> overhead for simple usecases, and it might be a good idea to figure out >> something lighter.
> Interesting. SimplePrincipalCollection is basically a wrapper around > a LinkedHashMap (key: realm name, value: LinkedHashSet of principals > (objects) from that realm). Replying to Les at the same time, but you have a very good point there Janne. Heavy cookies are especially bad for your health.. err.. I mean modern, all ajaxified web applications since that 700 bytes in cookies adds up quickly. I noticed earlier the cookie was abnormally (depending on your viewpoint) fat but didn't think too much about it. Putting it that way though, I think perhaps its something that should be corrected in the framework. It wouldn't work for the most generic case where realms could potentially change at runtime but that probably applies only to tiny percentages of use cases. Janne, please open an issue on this and if you like, you could also provide an initial patch, but I'll promise to take it up regardless. Kalle
