Hi,
I have a DB of 146MB - with 1_000_000 elements.
Loading the contents (objectDB query in java) takes about 10sec.
I am using a recent MacBook (SSD blabla - disk I/O speed is about 400MB/sec - according to blackMagicTest app for mac) - so I was expecting the query to take less than one sec (146/400 = 0.35sec.. + some overhead).
I was wondering if this kind of speed is "normal", or if this is something I should investigate.
So I created a database with 1_000_000 dummy entities (example below) - the DB size is only about 8MB - and it takes about 3sec to load the 1mio entities... still seems slow.
Thanks
EKK
import java.io.Serializable; import javax.persistence.Entity; @Entity public class BenchEnt implements Serializable { private static final long serialVersionUID = 1L; public BenchEnt() { } }
String d = System.getProperty("user.dir"); EntityManagerFactory emf = Persistence.createEntityManagerFactory(d + "/T1.odb"); EntityManager em = emf.createEntityManager(); if( false){ em.getTransaction().begin(); for( int i = 0; i < 1_000_000; i++){ BenchEnt ent = new BenchEnt(); em.persist(ent); } em.getTransaction().commit(); em.clear(); } if( true){ long t1 = System.currentTimeMillis(); TypedQuery<BenchEnt> query = em.createQuery("SELECT a FROM BenchEnt a", BenchEnt.class); List<BenchEnt> L = query.getResultList(); long t2 = System.currentTimeMillis(); long dt = t2-t1; System.out.println("LIST " + L.size() + " dt= " + dt); }