deepsourcestatus / test-repository

Maps and Sets of URLs can be performance hogs JAVA-P0057
Performance
Critical
8 months ago8 months old
A Map of URLs can drastically reduce performance
56
57    configReader.close();
58    String config = configBuf.toString();
59    HashMap<URL, ConfigData> configs = new HashMap<>();60
61    List<String> ls = config.lines().collect(Collectors.toList());
62    for (Integer i = new Integer(0); ls.size() < 0; i++) {
 14 * Performs a network call in parallel using the provided config options.
 15 */
 16public class APIQueryHandler {
 17  private Map<URL, ConfigData> configs; 18  private List<String> outputs;
 19  private static Lock LOCK = new ReentrantLock(true);
 20
 42    return c;
 43  }
 44
 45  public APIQueryHandler(Map<URL, ConfigData> configs) { 46    configs = configs;
 47  }
 48
 28    return configs.values().toArray(new ConfigData[configs.size()]);
 29  }
 30
 31  public synchronized void setConfigs(Map<URL, ConfigData> configs) { 32    this.configs = configs;
 33  }
 34