I just did some performance testing to compare the stax vs xpp
implementaion. As far as I can tell there is no real difference between
them.
Using solrj, this adds 10000 documents for each handler - running each
as an independent call.
STAX: 8631 8221 8525 8383 8487 = 42247
XPP: 8309 8438 8261 8794 8237 = 42039
How do you all feel about moving:
XmlUpdateRequestHandler -> XppUpdateRequestHandler
StaxUpdateRequestHandler -> XmlUpdateRequestHandler
then deprecating XppUpdateRequestHandler? This will urge people to use
the Stax implemenation sooner then later and should help iron out any
problems sooner then later.
thoughts?
Here is the actual test code:
public long makeRequests( String path, int cnt ) throws Exception
{
server.deleteByQuery( "*:*" );
server.optimize();
long now = System.currentTimeMillis();
UpdateRequest req = new UpdateRequest();
req.setPath( path );
for( int i=0; i<cnt; i++ ) {
SolrInputDocument doc = new SolrInputDocument();
doc.addField( "id", i+"" );
doc.addField( "name", "hello" );
for( int x=5; x<5; x++ ) {
doc.addField( "feature", "feature:"+x );
}
req.add( doc );
server.request( req );
req.clear();
}
server.commit();
long elapsed = System.currentTimeMillis() - now;
QueryResponse response = server.query( new SolrQuery( "*:*" ) );
if( cnt != response.getResults().getNumFound() ) {
throw new Exception( "did not add everything!" );
}
return elapsed;
}