> > For me, it was worthwhile to add an is_dirty() flag to the session object, > > and only flush it if something has changed - a relatively rare occurrence > > in my setup. > > You must not have noticed Session.is_empty(), which is the same as your > is_dirty() only of the opposite sense: Not true, actually. is_empty() says there's nothing of interest in the session object; is_dirty() says that what's in the session object does not match what's in the persistent store. jon Jonathan Corbet Executive editor, LWN.net corbet@lwn.net