alterm4nn/ChronoZoom — pull request #55 by javierluraschi (2013-03-13 19:41:20+00:00)
Title: Bug30: Loading data from SQL into the CZ website takes too long

Scenario: When ChronoZoom timeline cache refreshes (every 5 minutes), users experience a 30 seconds delay to load timeline data.

Defect: Loading data through the entity framework using Load() causes entity framework to generate one SQL query per entity, for all ChronoZoom data this triggered hundred of SQL calls. The measurement I got was 29.1268517 seconds required to load timeline data on cache-miss scenarios (ran in local environment)

Solution: Instead of loading data by loading entity properties, this change performs one query per entity to retrieve all elements. This reduces, the load process to 4 SQL queries (which should still be optimized and run in parallel but that's something to address in a subsequent improvement.) With this change, loading all ChronoZoom data into the cache averaged 0.5410725 seconds (ran in local environment).