final int rounds, final int countPersons, final int nodesPerEdge ) throws InterruptedException {
System.out.println( "Running benchmark for " + transcoder.getClass().getSimpleName() + "..." +
" (rounds: "+ rounds +", persons: "+ countPersons +", nodes: "+ ((int)Math.pow( nodesPerEdge, nodesPerEdge ) + nodesPerEdge + 1 ) +")" );
final TranscoderService transcoderService = new TranscoderService( transcoder );
final MemcachedBackupSession session = createSession( manager, "123456789abcdefghijk987654321", countPersons, nodesPerEdge );
final byte[] data = transcoderService.serialize( session );
final int size = data.length;
for( int r = 0; r < rounds; r++ ) {
final long start = System.currentTimeMillis();
for( int i = 0; i < 500; i++ ) {
transcoderService.serialize( session );
}
serializationStats.registerSince( start );
serializationStats.setSize( size );
}
System.gc();
Thread.sleep( 100 );
// deserialization
for( int r = 0; r < rounds; r++ ) {
final long start = System.currentTimeMillis();
for( int i = 0; i < 500; i++ ) {
transcoderService.deserialize( data, manager );
}
deserializationStats.registerSince( start );
deserializationStats.setSize( size );
}