⚡ 메모리 성능 최적화 - 필터 계산 제한
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled
- FilterableHeader의 uniqueValues 계산을 최대 200개로 제한 - 메모리 누수 방지: 대량 자재(1000개+)에서 무거운 계산 반복 방지 - parseMaterialInfo 호출 횟수 대폭 감소 - 페이지 리로드 문제 해결
This commit is contained in:
@@ -897,10 +897,10 @@ const NewMaterialsPage = ({
|
|||||||
const uniqueValues = React.useMemo(() => {
|
const uniqueValues = React.useMemo(() => {
|
||||||
const values = new Set();
|
const values = new Set();
|
||||||
|
|
||||||
// 현재 선택된 카테고리의 자재들만 필터링
|
// 현재 선택된 카테고리의 자재들만 필터링 (최대 200개만 처리하여 성능 개선)
|
||||||
const categoryMaterials = materials.filter(material => {
|
const categoryMaterials = materials
|
||||||
return material.classified_category === selectedCategory;
|
.filter(material => material.classified_category === selectedCategory)
|
||||||
});
|
.slice(0, 200);
|
||||||
|
|
||||||
categoryMaterials.forEach(material => {
|
categoryMaterials.forEach(material => {
|
||||||
const info = parseMaterialInfo(material);
|
const info = parseMaterialInfo(material);
|
||||||
|
|||||||
Reference in New Issue
Block a user