Commit b5d2ebe2 authored by Daniel Honsel's avatar Daniel Honsel
Browse files

use available number of cores

parent f24ef6aa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class TTCN3ResourceProvider {
	private ArrayList<String> paths;
	private LoggingInterface logger;
	private QualityCheckProfile activeProfile;
	private final int cores = Runtime.getRuntime().availableProcessors();
	
	@Inject
	private IQualifiedNameProvider qualifiedNameProvider;
@@ -70,7 +71,7 @@ public class TTCN3ResourceProvider {
		
		stopwatch.start();
		
		ExecutorService pool = Executors.newFixedThreadPool(4);
		ExecutorService pool = Executors.newFixedThreadPool(cores);
		ArrayList<FileParser> parser = new ArrayList<FileParser>();
		
		for (String path : paths) {
@@ -125,7 +126,7 @@ public class TTCN3ResourceProvider {

	public void analyzeResources() {
		Stopwatch watchAnalyzing = Stopwatch.createStarted();
		ExecutorService pool = Executors.newFixedThreadPool(4);
		ExecutorService pool = Executors.newFixedThreadPool(cores);
		
		// Check if resource is a ignored one and if so, do not analyze it.
		Pattern pattern = Pattern.compile(activeProfile.getIgnoredResourceRegExp());