Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/06/09 19:52:06 (15 years ago)
Author:
gkronber
Message:

Improved loading speed of CEDMA results by:

  • Limit number of models to the best 10% for each target variable
  • Cache sqlite rdf store to memory on first query

#286 (Variable-usage diagrams for the CEDMA frontend)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.DB/3.3/Store.cs

    r2053 r2137  
    7575        SemWeb.N3Reader n3Reader = new SemWeb.N3Reader(new StringReader(query));
    7676        SemWeb.Query.GraphMatch matcher = new SemWeb.Query.GraphMatch(n3Reader);
    77         matcher.Run(store, resultSink);
     77        if (memStore == null) {
     78          CacheStore();
     79        }
     80        matcher.Run(memStore, resultSink);
    7881        return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList();
    7982      }
    8083    }
    8184
     85    SemWeb.Store memStore;
     86    private void CacheStore() {
     87      memStore = new SemWeb.MemoryStore();
     88      memStore.Import(store);
     89    }
     90
    8291    public ICollection<VariableBindings> Query(ICollection<Statement> query, int page, int pageSize) {
    8392      lock (bigLock) {
    8493        MyQueryResultSink resultSink = new MyQueryResultSink();
    85         Translate(query).Run(store, resultSink);
     94        if (memStore == null) {
     95          CacheStore();
     96        }
     97        Translate(query).Run(memStore, resultSink);
    8698        return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList();
    8799      }
Note: See TracChangeset for help on using the changeset viewer.