-
Document.createDocumentFragment()카테고리 없음 2020. 11. 14. 23:03
DocumentFragment를 이용한 JavaScript 성능 최적화
자바스크립트의 DOM 객체는 연산을 수행할 때마다 DOM tree라는 자료구조에 접근해야 하기 때문에 자바스크립트의 성능을 저하시키는 주된 요인 중 하나이다. 따라서, 자바스크립트의 성능을 최
untitledtblog.tistory.com
developer.mozilla.org/ko/docs/Web/API/Document/createDocumentFragment
Document.createDocumentFragment()
새로운 빈 DocumentFragment 를 생성합니다.
developer.mozilla.org
document.createElement()를 이용하여 새로운 노드를 만들 때 마다 dom에 접근하는 것보다는 document.createDocumentFragment()를 이용하여 노드구조를 만들고 한번에 dom에 넣어버려 dom에 한번만 접근하는게 성능향상에 도움이 된다.