Hi,

still wondering why I see such differences in performances, I asked myself 
whether this is not related to the fact that my servlet doesn’t take care of 
concurrency: all my test queries are read-only, but real code should take care 
of it (and actually, this is one of the reasons why I was looking at fuseki: 
not to have to worry about this kind of troubles).

Note that in my very first experiment, when I was looking at times on the 
fuseki server side, I had started the fuseki server without the —update 
options, cf
./fuseki-server --mem /ds
instead of
./fuseki-server --update --mem /ds
and times were not better.

Anyway, I decided to try to add some minimal code in my servlet - I came to 
several questions regarding the way to do it (that I’ll ask in another 
message). For the moment, I just modified my doGetSparql method with:

        Dataset ds = getDataset(req);
        if (ds.supportsTransactions()) {
                ds.begin(ReadWrite.WRITE) ;
        } else {
                ds.getDefaultModel().enterCriticalSection(Lock.WRITE) ;
        }
        
        try {
                QueryExecution qexec = QueryExecutionFactory.create(query, ds);
                ...
        } finally {
                if (ds.supportsTransactions()) {
                        ds.end();
                } else {
                        ds.getDefaultModel().leaveCriticalSection() ;
                }
        }

(clearly, as I’m using a memory model, what is used is the 
“enterCriticalSection” mode. I don’t know how I could make it handle correctly 
the case where there are named graphs in the dataset, but I leave that for my 
next message)

The point is: this doesn’t change much of my results. My servlet is still much 
faster than fuseki

fps

Reply via email to