5 Replies Latest reply on Apr 29, 2016 11:18 AM by Gustavo Fernandes

    Is that normal permormance?

    Nikita Dobryukha Newbie

      Hi All,

      I've just tried to write simplest benchmark test.

      Book.java

      BookMarshaller.java

      book.proto

      infinispan.xml

      TestRealHotRodServer.java

      @Test
      public void testBooksCacheBenchmark() {
         final int MAX_CACHE_COUNT = 100_000;
         RemoteCache<Long, Book> cache = remoteCacheManager.getCache(BOOKS_CACHE_NAME);
        for (int i = 0; i < MAX_CACHE_COUNT; i++) {
        cache.put(UUID.randomUUID().getMostSignificantBits(), new Book("title" + i, "description" + i, 2000));
         }
        QueryFactory qf = Search.getQueryFactory(cache);
        for (int i = 0; i < 250; i++) {
        Query query = qf.from(Book.class).having("title").eq("title" + i*100).toBuilder().build();
        long startSearch = System.currentTimeMillis();
         List<Book> list = query.list();
        long finish = System.currentTimeMillis();
         LOG.info(String.format("search #%d: time = %.3fs", i, (finish - startSearch)/1000.0));
         }
        cache.clear();
      }
      
      

      I've got following results:
      100k cached records -- ~0.087s per search

      250k cached records -- ~0.210s per search

      500k cached records -- ~0.420s per search

       

      Is that normal performance?

       

      I use Infinispan Server 8.2.1. Infinispan instance is on the same machine with test application.

      Intel Core I5-4570 @ 3.20 GHz, 16gb RAM