Skip to content

Instantly share code, notes, and snippets.

@wendal
Created April 18, 2014 08:11
Show Gist options
  • Save wendal/11030973 to your computer and use it in GitHub Desktop.
Save wendal/11030973 to your computer and use it in GitHub Desktop.
@Test
public void test_1000_threads() throws InterruptedException {
final JQ jq = new JQ(100, -255, -1);
ExecutorService es = Executors.newFixedThreadPool(1000);
for (int i = 0; i < 1000*1000; i++) {
es.submit(new Runnable() {
@Override
public void run() {
Json.toJson(jq);
}
});
}
es.awaitTermination(5, TimeUnit.MINUTES);
es.shutdown();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment