db4o写入速度惊人

db4o 数据写入速度惊人,10万条数据插入,耗时才3094ms
import java.util.List;
import com.db4o.Db4oEmbedded;
import com.db4o.ObjectContainer;


public class TestDb4o {
	public static void main(String[] args) {
		ObjectContainer db = Db4oEmbedded.openFile(Db4oEmbedded
		        .newConfiguration(), "testEb");
		try {
			long start=System.currentTimeMillis();
			for(int i=0;i<100000;i++){
				Student stu=new Student("ls","男");
			    db.store(stu);
			}
			long end=System.currentTimeMillis();
			System.out.println(end-start);
		    List <Student> stuList = db.query(Student.class);
		    int size=stuList.size();
		    for (int i=0; i<size ;i++){
		    	System.out.println(stuList.get(i).toString());
		    }
		} finally {
		    db.close();
		}
	}
	
}


官方基准测试数据
db4o写入速度惊人

你可能感兴趣的:(java)