             let timeString = text.substringToIndex(text.startIndex.advancedBy(match.range.length - 4))
             if let time = Double(timeString) {
                 let value = text.substringFromIndex(text.startIndex.advancedBy(match.range.length - 1))
-
-                let cumulativeTime = rawMeasures[value] ?? 0
-                rawMeasures[value] = cumulativeTime + time
+                if var rawMeasure = rawMeasures[value] {
+                    rawMeasure.time += time
+                    rawMeasures[value] = rawMeasure
+                } else {
+                    rawMeasures[value] = CMRawMeasure(time: time, text: value)
+                }
             }
             if shouldCancel {
                 break
             }
         }
-
-        for (k, v) in rawMeasures {
-            // Only show files whose compile time is above 10ms
-            if v > 10 {
-                unprocessedResult.append(CMRawMeasure(time: v, text: k))
-            }
-        }
-
         processingDidFinish()
     }
     
     private func updateResults(didComplete: Bool) {
-        var results = processResult(unprocessedResult)
-        results = groupResultsBySourceLine(results)
-        results.sortInPlace{ $0.time > $1.time }
-
-        updateHandler?(result: results, didComplete: didComplete)
+        let unprocessedResult = rawMeasures.values.filter({ $0.time > 10 }).sort({ $0.time > $1.time })
+        updateHandler?(result: processResult(unprocessedResult), didComplete: didComplete)
         if didComplete {
-            unprocessedResult.removeAll()
+            rawMeasures.removeAll()
         }
     }
-
+    
     private func processResult(unprocessedResult: [CMRawMeasure]) -> [CMCompileMeasure] {
         var result: [CMCompileMeasure] = []
         for entry in unprocessedResult {


class CMLogProcessor: NSObject, CMLogProcessorProtocol {
    
    var unprocessedResult: [CMRawMeasure] = []
    var updateHandler: CMUpdateClosure?
    var workspace: CMXcodeWorkSpace?
    var shouldCancel = false

            }
        }
        return result
    }
    
    private func trimPrefixes(code: String) -> String {
