Reduce session_data filesize and some minor cleanup.

After a year of not cleaning up the '~/.lnav' folder, the folder was
consuming ~8Mb of disk space. This change tries to reduce the disk
consumption by the session_data files.

- The json data in the session_data is beautified. The extra characters
  contribute to some of the file size. After removing the beautification
  option, the file size reduces by 60-20%, depending on how many files
  are open.

  Without knowing much about the functionality of these files, my
  cursory tests seem to show that lnav can still restore the sessions
  after this change. I don't know if these files are meant for human
  consumption or not but they can easily be run through a linter to
  beautify them again.

- While I was in the file, I noticed that there was a scope declared
  with no code inside it. Seems like a remnant of a cleanup.
This commit is contained in:
Suresh Sundriyal 2014-11-05 19:11:14 -08:00
parent deeac1a5db
commit f8ad3479db

View File

@ -1183,7 +1183,6 @@ void save_session(void)
perror("Unable to create yajl_gen object"); perror("Unable to create yajl_gen object");
} }
else { else {
yajl_gen_config(handle, yajl_gen_beautify, 1);
yajl_gen_config(handle, yajl_gen_config(handle,
yajl_gen_print_callback, yajl_writer, file.in()); yajl_gen_print_callback, yajl_writer, file.in());
@ -1274,10 +1273,6 @@ void save_session(void)
} }
root_map.gen("commands"); root_map.gen("commands");
{
}
} }
yajl_gen_clear(handle); yajl_gen_clear(handle);