Pages

Showing posts with label Delete. Show all posts
Showing posts with label Delete. Show all posts

Thursday, May 30, 2013

A huge pile of tmp files and CCleaner to the rescue

I've been working on a tool to measure the performance of print jobs and one little bug in it completely destroyed my day at work, but Luckily I had CCleaner to help me fix the problem. The concept of the tool is simple, but because I have to use multithreading it's gotten pretty complex, revision over revision.

The objective of the tool is simple. Whenever we make a substantial modification to the source of the renderer, we have to test for any degradation in performance. We have a bunch of XPS files and we simply use the AddJob method of the PrintQueue API to send the XPS data to the printer. This was a simple tool which was developed in the ancient days. So we add job after job to the printer and measure how long it takes to finish each print job. There was a separate tool that automatically dumped the start time and the finish time of the print job. (Did you think we measured it using a stopwatch?) Obviously we have to do this few time for each XPS file and take the average. It is such time waste.
 
The tool I wrote does this automatically. I just have to install the printer driver, load the data and bang. So easy. A lot of time saving.
 
There were some issues though. One of them was, sometimes the PrintFilterPipelineService, which is the process the print job is managed by, since Vista days, sometimes skips the print the job without doing anything if a new job is sent soon after the previous one finished.  I've noticed this on my Athlon X2 4200+ rig, but not on the Core i7 2600 rig or the common test rig with Core i5 750. Anyways, the solution was to kill that process after every print job.
 
That worked fine until I had to measure the performance of a large amount of XPS files last week. I could actually finish the performance test alright, but the next day when I booted into Windows in the morning, the desktop didn't respond to my inputs for about 10 minutes!!! The problem didn't go away even after a multiple reboots. When I checked the Resource Monitor, I noticed that the Print Spooler service was doing a lot of I/O. When I stopped the Print Spooler service, the stalling stopped. But I need the Print Spooler service running. After a little bit of snooping around, I found the problem.
 

Thursday, September 20, 2012

A faster way to delete large folders in Windows without using 3rd party apps

Ever since Microsoft released Windows Vista, file deletion had been very slow in Windows Explorer. It was very noticeable when you were deleting a huge folder with hundreds of thousands of files.

I frequently encounter this problem at work. The XPS driver source itself is huge and for certain tests I have to check out multiple versions of the source. Ultimately you crowd up the hard drive with files that you don’t even want to refer again. Then there comes the day you have to clean up the junk because you are running out of space in the drive. Deleting files using the Windows Explorer will take forever. I usually did this while we were out for lunch.

But I was curious. There should be a faster way. And I found one, which is about 2 to 3 times faster than deleting them through Windows Explorer. But you lose the progress bar and the fancy animations.

Related Posts Plugin for WordPress, Blogger...