Skip to content

Commit

Permalink
Tweak parameters / region order
Browse files Browse the repository at this point in the history
Tried a few different combinations and this seemed to be the most stable

fixup params
  • Loading branch information
maurizi committed Jan 7, 2022
1 parent e8ea4f1 commit 3ac8ed3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/server/src/districts/services/topology.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import _ from "lodash";
import { getObject, s3Options } from "../../common/s3-wrapper";

const MAX_RETRIES = 5;
const BATCH_SIZE = cpus().length;
const BATCH_SIZE = cpus().length * 2;
// 10 largest states by population
const STATE_ORDER = ["CA", "TX", "FL", "NY", "PA", "IL", "OH", "GA", "NC", "MI"];

Expand Down Expand Up @@ -65,10 +65,8 @@ export class TopologyService {
}),
{}
);
// Load archived regions first, as they use less memory
// Within that, load largest states first
// Load largest states first
const sortedRegions = _.sortBy(regionConfigs, region => [
!region.archived,
!STATE_ORDER.includes(region.regionCode),
STATE_ORDER.indexOf(region.regionCode)
]);
Expand Down

0 comments on commit 3ac8ed3

Please sign in to comment.