Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Reduce pageSize when downloading to 10
Browse files Browse the repository at this point in the history
At a pageSize of 50 with `detail=true` we are seeing response times near 30s,
sometimes timing out.

In some brief testing reducing the pageSize to 10 results in requests that take
3 to 6 seconds. Setting a pageSize of 20 doubles the response time but
interestingly setting a pageSize of 5 doe _not_ reduce the request time. There
appears to be a performance floor.
  • Loading branch information
jwalgran committed Mar 22, 2022
1 parent 49c081d commit 35b0a21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Changed

- Reduce pageSize when downloading to 10 [#1763](https://github.com/open-apparel-registry/open-apparel-registry/pull/1763)

### Deprecated

### Removed
Expand Down
4 changes: 2 additions & 2 deletions src/app/src/components/DownloadFacilitiesButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
failLogDownload,
} from '../actions/logDownload';
import { fetchFacilities } from '../actions/facilities';
import { FACILITIES_REQUEST_PAGE_SIZE } from '../util/constants';
import { FACILITIES_DOWNLOAD_REQUEST_PAGE_SIZE } from '../util/constants';

const downloadFacilitiesStyles = Object.freeze({
listHeaderButtonStyles: Object.freeze({
Expand Down Expand Up @@ -48,7 +48,7 @@ function DownloadFacilitiesButton({
dispatch(startLogDownload());
dispatch(
fetchFacilities({
pageSize: FACILITIES_REQUEST_PAGE_SIZE,
pageSize: FACILITIES_DOWNLOAD_REQUEST_PAGE_SIZE,
detail: true,
onSuccess: () => dispatch(logDownload(format, { isEmbedded })),
onFailure: () => dispatch(failLogDownload()),
Expand Down
1 change: 1 addition & 0 deletions src/app/src/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { checkWhetherUserHasDashboardAccess } from './util';
export const OTHER = 'Other';

export const FACILITIES_REQUEST_PAGE_SIZE = 50;
export const FACILITIES_DOWNLOAD_REQUEST_PAGE_SIZE = 10;

export const WEB_HEADER_HEIGHT = '80px';
export const MOBILE_HEADER_HEIGHT = '68px';
Expand Down

0 comments on commit 35b0a21

Please sign in to comment.