RongtongJin commented on code in PR #7583: URL: https://github.com/apache/rocketmq/pull/7583#discussion_r1410374838
########## namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java: ########## @@ -131,6 +134,25 @@ public void getAllTopicList() { assertThat(topicList.getTopicList()).contains("TestTopic", "TestTopic1", "TestTopic2"); } + @Test + public void hugeTopicListAddTest() { + Set<String> mapSet = ConcurrentHashMap.newKeySet(); + Set<String> copyOnWriteArraySet = new CopyOnWriteArraySet<>(); + HashSet<String> topics = new HashSet<>(); + + for (int i = 0; i < 100000; ++i) { + topics.add("Topic" + i); + } + long startTime = System.currentTimeMillis(); + mapSet.addAll(topics); + long endTime = System.currentTimeMillis(); + assertThat(endTime - startTime < 100).isTrue(); + startTime = System.currentTimeMillis(); + copyOnWriteArraySet.addAll(topics); + endTime = System.currentTimeMillis(); + assertThat(endTime - startTime > 3000).isTrue(); + } Review Comment: It seems that this test is unnecessary -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org