Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not sure if you agree with all the changes, but I'll try to explane them.
The original idea was to add standard sorting by filename to the table. I found it might be quite convenient to work file by file.
There were already several variants of data source in the ViewController (dataSource, filteredData, perFunctionTimes, perFileTimes), so adding one more wasn't an option. So I decided to incapsulate all the processing over the data array to a separate class (ViewControllerDataSource), store only one original array of items and apply all the aggregating, filtering and sorting dynamically if necessary. In my opinion it makes code and the logic cleaner and easily lets extend processing functionality (other operations under the data array if necessary).
Unfortunately I had to convert CompileMeasure to an objC class for being able to easily apply an array of sort descriptors. I couldn't find easy and elegant way to apply several sorting functions to swift array without a lot of pain (didn't want to implement something like http://chris.eidhof.nl/post/sort-descriptors-in-swift/). I thought that inheriting the model from NSObject and double casting the array (to NSArray and back to swift array) is not such a big deal considering the ability to use good old sort descriptors (which are built in to NSTableView)
All the basic functionality of ViewControllerDataSource is covered with tests.