for all SSD users with Ramdrive and Firefox >= 3.5![]()
this tool took the sqlite-journals (really many small writes) and put them on the ramdrive and create symlinks.
why this tool ? firefox deletes this files on close and the symlinks are lost. this tool recreates them![]()
usage:
"FireWatcherSSD.exe profiledir"
i.e.
FireWatcher .exe "C:\Users\you\AppData\Roaming\Mozilla\Firefox\Profiles\xxgg2233.default"
sourcecode![]()
Code:using System; using System.Collections.Generic; using System.IO; using System.Threading; using System.Runtime.InteropServices; using System.Windows.Forms; namespace FireWatcherSSD { class Program { [DllImport("kernel32.dll")] static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, int dwFlags); private const string FileExt = ".sqlite-journal"; private static List<string> _journals; private static string Profiledir; static void Main(string[] args) { if (args.Length == 0 || !Directory.Exists(args[0])){ MessageBox.Show( "pls provide firefox profiledir thru commandline"); return; } Profiledir = args[0]; _journals = new List<string>{"downloads","cookies","places"}; foreach(var journal in _journals) CheckJournal(journal); var watcher = new FileSystemWatcher(Profiledir, "*.sqlite-journal") {EnableRaisingEvents = true}; watcher.Deleted += WatcherDeleted; Thread.Sleep(Timeout.Infinite); } private static void CheckJournal(string Journal) { var orgFile = Path.Combine(Profiledir, Journal + FileExt); var ramFile = Path.Combine(@"R:\",Journal + FileExt ); if (!File.Exists(orgFile ) || (new FileInfo(orgFile).Attributes & FileAttributes.ReparsePoint) == 0){ if (!File.Exists(ramFile))File.Create(ramFile).Close(); if(File.Exists(orgFile))File.Delete(orgFile); CreateSymbolicLink(orgFile , ramFile, 0); } } static void WatcherDeleted(object sender, FileSystemEventArgs e) { var journal = e.Name.Replace(FileExt, ""); if (!_journals.Contains(journal)) return; CheckJournal(journal); } } }
-
I got no idea what you are talking about
Could you care to explain a little more?
I got an SSD and i`m looking around for new tips tweaks!
Cheers -
1. SSD writing = wearout. so avoid writing
2. SSD writing of small blocks are slow.
if you want to write 4k to ssd the ssd read a 512k block into memory
then it replace the 4k you want to write within this block in memory
then it erase the 512k on the ssd (write zeros)
and then the ssd write the new 512k block back to ssd.
so avoid writing small block !!!
firefox use sqlite for cookies and places. (cookies.sqlite)
sqlite use a transaction file for rollback. (cookies.sqlite-journal)
sqlite really often writes 4k blocks to those journals !!
from time to time sqlite put this journal into the main sqlite file this is a 1024k write this is ok
so i thought putting these journalfiles to ramdisk is an good idea
FireWatcherSSD
Discussion in 'Acer' started by inteks, Dec 9, 2009.