Entify – Performance test
I wanted to test Entify‘s performance, so I wrote a simple test application and timed entity context operations of the Entify framework. During this process, I found two defects from the project and fixed them on the way. Fixes are committed to Entify trunk.

Test model
Above is a entity model I used in testing. My testing was by no means complete or scientific, but I wanted to get an overall picture of the performance. I created a model that could be used in music player application. In real applications there would be more properties in each entity type, but this was enough for my testing purposes.
I started by adding 100 artists to the context. Each artist had 10 albums which contained 15 tracks each. So all in all, I added 100 artists, 1000 albums and 15,000 tracks to the entity context. The way I did it is not the fastest, but probably the most intuitive way of doing it. I started by inserting 100 artists with one Add() call. After that I looped over albums and tracks and inserted them seprately. All in all, adding all this stuff to context took 1101 Add() calls. With little performance tweaking we could achieve the same with 3 Add() calls. One for each entity type. This would make it probably a lot faster. Anyhow, I wanted to see the performance of quick and dirty solution. (And I really didn’t have time to optimize the test code) :) Here are the results.
| Operation | Time spent by Entify |
| Added 100 artists, 1000 albums, 15,000 tracks. | 13.087 sec |
| Requested tracks with genre filter. Returned 7500 tracks | 3.153 sec |
| Requested tracks with two filters. Returned 4227 tracks | 1.776 sec |
| Requested artist by name. | 0.007 sec |
| Requested album by name. | 0.010 sec |
Since Entify uses lazy approach, the time of add operations actually includes also the time that was spent on creating the file for data and creating the entity model (tables and indexes) into the database.
I got these results by executing the Mono console app on my 2 years old iMac.
