@Test public void performance() { r.performance(); }
void performance() { List<Company> companies = new ArrayList<>(); int count = 333334; while (count >= 0) { companies.add(new Company("Washington", r0.nextInt())); companies.add(new Company("China", r1.nextInt())); companies.add(new Company("UK", r2.nextInt())); count--; } long start = System.currentTimeMillis(); Collections.sort(companies, comparator); List<Company> result = removeDuplicateUsers(companies, 2); long end = System.currentTimeMillis(); for (Company company : result) { _log.debug(company.toString()); } _log.debug("time:{} ms", end - start); }
RemoveDuplicateAndSort { void performance() { List<Company> companies = new ArrayList<>(); int count = 333334; while (count >= 0) { companies.add(new Company("Washington", r0.nextInt())); companies.add(new Company("China", r1.nextInt())); companies.add(new Company("UK", r2.nextInt())); count--; } long start = System.currentTimeMillis(); Collections.sort(companies, comparator); List<Company> result = removeDuplicateUsers(companies, 2); long end = System.currentTimeMillis(); for (Company company : result) { _log.debug(company.toString()); } _log.debug("time:{} ms", end - start); } }
RemoveDuplicateAndSort { void performance() { List<Company> companies = new ArrayList<>(); int count = 333334; while (count >= 0) { companies.add(new Company("Washington", r0.nextInt())); companies.add(new Company("China", r1.nextInt())); companies.add(new Company("UK", r2.nextInt())); count--; } long start = System.currentTimeMillis(); Collections.sort(companies, comparator); List<Company> result = removeDuplicateUsers(companies, 2); long end = System.currentTimeMillis(); for (Company company : result) { _log.debug(company.toString()); } _log.debug("time:{} ms", end - start); }  }
RemoveDuplicateAndSort { void performance() { List<Company> companies = new ArrayList<>(); int count = 333334; while (count >= 0) { companies.add(new Company("Washington", r0.nextInt())); companies.add(new Company("China", r1.nextInt())); companies.add(new Company("UK", r2.nextInt())); count--; } long start = System.currentTimeMillis(); Collections.sort(companies, comparator); List<Company> result = removeDuplicateUsers(companies, 2); long end = System.currentTimeMillis(); for (Company company : result) { _log.debug(company.toString()); } _log.debug("time:{} ms", end - start); }   }
RemoveDuplicateAndSort { void performance() { List<Company> companies = new ArrayList<>(); int count = 333334; while (count >= 0) { companies.add(new Company("Washington", r0.nextInt())); companies.add(new Company("China", r1.nextInt())); companies.add(new Company("UK", r2.nextInt())); count--; } long start = System.currentTimeMillis(); Collections.sort(companies, comparator); List<Company> result = removeDuplicateUsers(companies, 2); long end = System.currentTimeMillis(); for (Company company : result) { _log.debug(company.toString()); } _log.debug("time:{} ms", end - start); }    }