프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기Chang W. DohTalk about H/W acc. and rendering performance of chrome, and one more short talk about ServiceWorker.
알아봅시다, Polymer: Web Components & Web AnimationsChang W. DohGDG Korea WebTech : 시작하세요, Polymer, Oct, 11, 2014.
Let's learn about specifications before diving into Polymer:
- Web Components
- Web Animations
This slide includes resources from HTML5Rocks, Polymer and PolyTechnic.
Angularjs, ionic, cordova 기반 syrup store app 개발 사례 공유Sang Seok LimThe best practice of Android application development based on Anjularjs, Ionic, Cordva based Android application
혁신적인 웹컴포넌트 라이브러리 - PolymerJae Sung ParkPolymer의 기술기반인 Web Componets를 구성하는 표준 스펙들인 Custom Elements, HTML Imports, HTML Templates 그리고 Shadow DOM을 간략히 살펴본다.
Polymer의 아키텍처 및 기본적인 사용방법 그리고 material design이 적용된 paper elements 등을 살펴본다.
초보 개발자를 위한 웹 프론트엔드 개발 101Chang W. Doh2016년 11월 5일 있었던 GDG DevFest 2016 Seoul 행사에서 진행된 `Boot Camp: 초보 개발자를 위한 웹 프론트엔드 개발 101` 워크숍의 소개 부분 슬라이드입니다.
- 행사 URL: https://festi.kr/festi/gdg-korea-2016-devfest-seoul/program/92/
Angularjs, ionic, cordova 기반 syrup store app 개발 사례 공유Sang Seok LimThe best practice of Android application development based on Anjularjs, Ionic, Cordva based Android application
혁신적인 웹컴포넌트 라이브러리 - PolymerJae Sung ParkPolymer의 기술기반인 Web Componets를 구성하는 표준 스펙들인 Custom Elements, HTML Imports, HTML Templates 그리고 Shadow DOM을 간략히 살펴본다.
Polymer의 아키텍처 및 기본적인 사용방법 그리고 material design이 적용된 paper elements 등을 살펴본다.
초보 개발자를 위한 웹 프론트엔드 개발 101Chang W. Doh2016년 11월 5일 있었던 GDG DevFest 2016 Seoul 행사에서 진행된 `Boot Camp: 초보 개발자를 위한 웹 프론트엔드 개발 101` 워크숍의 소개 부분 슬라이드입니다.
- 행사 URL: https://festi.kr/festi/gdg-korea-2016-devfest-seoul/program/92/
Hellotutorialhellotutorial구글 크롬 익스텐션을 이용해서 누구나, 어떠한 사이트라도 쉽고 빠르게 튜토리얼을 제작하고 볼 수 있는 서비스 입니다. 이렇게 제작된 튜토리얼들은 해당 웹사이트 위에 동적으로 삽입되어 사용자에게 비춰지며, 사용자들은 클릭 몇 번으로 웹사이트의 다양한 기능들을 익힐 수 있습니다.
2016 네이버sw기술소개NAVER EngineeringThis document contains statistics about Naver's services and products. It states that Naver has over 311 million questions and answers, 1.7 million entries in its knowledge encyclopedia, 520 webtoons and 140,000 amateur webtoonists. It also provides user numbers for various Naver services and technologies used in Naver's infrastructure and applications.
웹을 지탱하는 기술JungHyuk Kwon인터넷의 역사부터 웹의 탄생, HTTP 와 REST 등, 우리가 현재의 웹을 이해하는데 필요한 것들만 정리 했습니다.
현업에 개신 개발자 분들은 다들 아시는 내용이겠지만, 정작 우리 주위엔 웹을 많이들 쓰고, 관련해서 일을 하면서도 웹의 내부에 대해서는 잘 모르고 있는 사람들이 많습니다.
웹의 기반기술을 제대로 아는것이, 우리가 좀더 웹을 진지하게 접근하는 것의 시작이라고 생각합니다.
[2018] 프런트엔드 성능 최적화NHN FORWARD커지고 있는 웹 애플리케이션에서 성능은 점점 더 중요한 요소가 되고 있습니다. 사용자와의 접점에서 긴밀한 상호작용을 요구하는 프런트엔드, 보다 빠르게 로딩되고 부드럽게 구동되어야 하는 웹 애플리케이션을 만들기 위해 노력하는 분들과 함께 이야기를 나눕니다.
목차
1. 로딩 최적화 방법
2. PWA 케이스 소개
3. 렌더링 최적화 방법
대상
- 프런트엔드 성능 개선을 시작하고 싶은 개발자
- 느린 웹 페이지를 빠르게 만드는 데 관심 있는 프런트엔드 개발자
- 로딩/렌더링 최적화에 대한 힌트를 얻고 싶은 개발자
실 사례로 보는 고객 디지털 경험 지키기IMQA 2022년 11월 18일 코엑스에서 개최한 공공솔루션마켓에서 발표한 강연 자료입니다.
디지털 전환이 갶속화됨에 따라 더욱 중요해진 디지털 경험 모니터링과 장애 및 병목 등 성능을 개선한 실 사례를 공유드립니다.
생생한 강연 영상으로 확인해 보세요!
https://youtu.be/_Cdms2TxO3M
모바일 앱 성능 분석 방법 101 (Mobile Application Performance Analysis Methodology 101) YoungSu Son모바일 앱 성능 분석 방법에 대해서 설명을 드립니다
- 기존 서버 APM과 모바일에서의 성능 기준의 차이
- 모바일 제약사항및 아키텍처
- 안드로이드는 어떻게 발전해 왔나
- Vectorization
- Loop
- Redex / Optimized Layout
- Garbage Collector
- 제조사가 보장해야 되는 성능
- 개발사가 고민해야 되는 영역
- 실사례 설명
- 갤럭시노트 2의 점유율
- Xiaomi 폰의 국내 4위 시장 점유율
- 여러가지 모바일 성능 리포트
Exploring what're new in Web for the Natively appChang W. DohThe document discusses new features for web applications and their integration with native applications. It explores what's new for PWAs and how they can have more native-like features. It also covers tips for PWAs and how web applications can better integrate with native applications, providing an example JSON configuration to define related native applications. The author is Chang W. Doh, a Web GDE, and their email is provided for contact.
Kotlin의 코루틴은 어떻게 동작하는가Chang W. DohThe document discusses Kotlin coroutines and asynchronous programming. It demonstrates how to write asynchronous code using coroutines and covers topics like launching coroutines with different dispatchers, cancelling coroutines, and handling timeouts. Key functions and concepts discussed include launch, delay, runBlocking, withTimeout, and coroutine contexts/dispatchers.
Hey Kotlin, How it works?Chang W. DohThe document contains code examples showing how Kotlin code is compiled to Java bytecode. It demonstrates how Kotlin classes, functions, properties, and other language features are represented in the compiled Java code. Key aspects that are summarized include data classes, property delegates like lazy, extension functions, and overriding behavior.
Kotlin, 어떻게 동작하나요Chang W. DohGDG DevFest 2017 - Inspections of Kotlin implementations by Bytecode.
세션 이후 "Kotlin은 Java의 wrapper인가요?" 라는 질문을 몇번 받았습니다.
—
답변: 그렇지 않습니다.
특정한 언어로 구현된 코드는 파싱을 거쳐 추상화된 형태(AST)와 추가 정보들을 가지는 1차적인 결과물로 처리됩니다. 보통 이런 역할을 하는 것은 컴파일러에서 전단부(frontend)라고 호칭하며 이러한 AST 등의 결과물은 대상 머신이나 플랫폼에 맞추어 처리됩니다.
이를 바로 실행하면 인터프리터라고 하지만, 실행 가능한 형태(Executable)로 생성하는 경우라면 컴파일러 후단부(Backend)가 이를 수행합니다.
백엔드의 타겟 코드는 충분히 다양한 대상을 다룰 수 있으므로, 우리가 다양한 백엔드 구현을 통해 동일 코드를 멀티 플랫폼을 대상으로 실행할 수 있도록 할 수 있는 것입니다.
코틀린 역시 대상으로 하는 플랫폼(과 머신)은 현재 다음과 같은 실행 가능한 형태를 지원하고 있습니다. (물론 아직 모든 타겟이 완벽하지는 않겠죠.)
1. Bytecode 포맷에 따른 JVM(안드로이드 포함)
2. JavaScript에 의한 브라우저나 Node.js
3. llvm을 이용하여 여러 타겟의 네이티브 코드
이 자료는 이 중 1번을 기반으로 디컴파일된 코드를 살펴보고 코틀린의 코드 생성 목적이나 언어 설계의 원인(어떤 painpoint)를 찾아보는 과정의 일부였을 뿐입니다.
언어는 항상 요구되는 표현을 위해 가장 적합한 형태로 변화해나갑니다. 프로그래밍 언어는 비교적 단기간에 만들어지는 언어이고, 그에 따라 특정 사람과 집단의 목적에 충실합니다. 다만, 이 관점에서 봤을 때도 Kotlin이 Java의 wrapper로써 설계되었을 것보다는 다양한 타겟 플랫폼이 고려되고 있는 하나의 프로그래밍 언어로 받아들여 주시기를 바랍니다. :)
introduction to Web Assembly Chang W. DohThe document discusses Web Assembly (WASM) and its ability to run JavaScript code. WASM code can access the same Web APIs as JavaScript, including the DOM, Web Audio, and Web GL. It also mentions that WASM acts as a compiler target and bytecode format for the web.
PWA Roadshow Seoul - KeynoteChang W. DohThis document discusses progressive web apps and their advantages over traditional apps. Some key points:
- Progressive web apps have seen significant growth and now account for 13% of mobile page views, up from 3.53% previously.
- Features like push notifications, service workers and app-like behaviors allow progressive web apps to mimic native apps while avoiding app stores.
- Adoption has increased engagement and time spent on sites with progressive web apps, with an average of 76% more time spent on iOS and 30% more on Android.
- Major companies have seen success with progressive web apps, with some seeing over 1 million installs and 60% of users engaging with push notifications. Progressive web apps are poised
PWA Roadshow Seoul - HTTPSChang W. DohPWA Roadshow Seoul: HTTPS
Google PWA Roadshow HTTPS 세션의 한국어 번역본
사이트: https://gdg-korea-webtech.firebaseapp.com/pwa-roadshow17/
CSS 다시 파서 어디에 쓰나Chang W. DohEmocon 2017 S/S 발표: 개인 프로젝트였던 자바스크립트 기반의 CSS Parser를 왜 만들었는가에 대한 우문우답.
Project GitHub: https://goo.gl/mK6DTU
NPM Reg.: https://goo.gl/aEFYSI
Service Worker 201 (en)Chang W. Doh1. Service Workers enable persistent background processing and provide hooks to take advantage of offline capabilities and push notifications in web applications.
2. They behave similarly to web workers but provide features like installation, versioning and upgrades that make them suitable for background processing even when a page is unloaded.
3. The Service Worker lifecycle is independent of web pages and browsing sessions, making it well-suited for features like push notifications, background sync and remote notifications.
Service Worker 101 (en)Chang W. DohWeb workers allow running scripts in parallel to the main page thread using message passing. Service workers are a specific type of web worker that enable persistent background processing and features like push notifications and offline caching. They have a lifecycle that is independent of pages and provide event-driven processing and version management. While dedicated and shared workers are created and controlled at runtime, service workers are installed in the browser and provide persistent background processing capabilities even when pages aren't active.
Instant and offline apps with Service WorkerChang W. Doh2 parts of talking at Google Developer Summit 2016 Seoul
- How to optimize loading performance your web app
- Introducing to Service Worker & Offline 101
Chrome enchanted 2015Chang W. DohThis document contains slides from a presentation on Polymer and modern web APIs. The slides discuss how Polymer uses web components to build reusable custom elements, and how this allows for component-based development. They provide examples of popular elements like <paper-tabs> and <core-toolbar> that are used as building blocks. The slides also showcase several production uses of Polymer at Google scale, including the Google Santa Tracker application. They emphasize how Polymer leverages modern web platform APIs to build fast, modular, and powerful applications.
SOSCON 2014: 문서 기반의 오픈소스 기여하기Chang W. DohSamsung OpenSource Conference - Day 2. http://www.soscon.net/
코드가 아닌 문서로 오픈소스에 기여하는 방법을 개인적인 경험으로 정리해보았습니다. 참여하실 분은 언제나 환영합니다. :)
Chromium: NaCl and Pepper APIChang W. DohNative Client (NaCl) is an open-source technology that allows native code to run safely inside web browsers. It provides native code functionality and performance while maintaining security. NaCl code is sandboxed using a double sandbox model and only accesses system resources through a safe API. The Portable Native Client (PNaCl) variant compiles code into a portable format that can run on multiple platforms.
Cache in Chromium: Disk CacheChang W. DohThe document discusses Chromium's caching system. It describes the overall network stack and cache flow, including the disk cache which stores web resources on disk. It then focuses on the "simple cache" implementation, a new backend for disk cache that uses one file per cache entry and an index file for faster lookups. The simple cache aims to be more resilient to corruption, reduce delays, and have lower memory and disk usage than the existing blockfile backend.
Ninja Build: Simple Guide for BeginnersChang W. DohNinja is a build system that focuses solely on speed. It aims to have the fastest possible build times by keeping things very simple - it has almost no built-in functionality and relies on external meta-build systems like GYP or CMake to generate the build specification files (ninja files). Ninja files describe dependencies between targets but don't include complex build logic. This keeps the overhead of the build system very low and allows builds to be highly parallelized.
OVERVIEW: Chromium Source TreeChang W. DohThe document provides an overview of the top-level projects that make up the Chromium source tree. It describes projects such as /android_webview, /base, /build, /cc, /chrome, /components, /content, /ipc, /mojo, /net, /sandbox, /skia, /third_party, /ui, /v8, and /webkit that comprise the core functionality and architecture of the Chromium browser.
2. Chang W. Doh
GDG WebTech Organizer
HTML5Rocks/KO Contributor/Coordinator
</hi><hi>
3. 하드웨어 갶속, CPU, GPU
GPU 렌더링 프로세스
성능 이슈의 발생 요인
크롬의 웹 페이지 렌더링 과정
렌더링 성능 최적화에 대한 토론
GDG Korea WebTech - Unexpected Workshop
프론트엔드 개발자를 위한
크롬의 렌더링 성능 인자 이해
하기
28. “GPU는 수신된 데이터로 무언가를 그리는데 적
합”
1. 텍스쳐를 가지고 이미지를 빠르게 출력 가능
2. 이미 가진 텍스쳐는 다시 받지 않고 재활용
3. 회전, 확대, 축소, 기울임, 반투명 처리 등
4. 위 기능들의 동시 처리하는 것도 매우 최적화
GPU가 잘하는 것
30. FACT> “비디오 메모리로의 데이터 전송은 느림”
비디오 메모리로의 데이터 전송 속도
Main Memory
CPU
Video Memory
GPU
BUS
31. “데이터 전송 시간 = 데이터의 크기 / BUS 속도”
● 일반적으로 예상되는 데이터 크기:
o GPU 명령 < 버텍스 < 텍스쳐 이미지
이슈: 비디오 메모리로의 전송 속도
32. FACT> “GPU의 데이터는 CPU에서 생성 후 전
송”
더 큰 이슈: CPU 처리 시간
데이터
CPU
2 VRAM
GPU
1
3
렌더
링
예> 코드에 의
해 텍스쳐로 사
용될 이미지를
생성
즉, 렌더링의 관점에서 GPU에서 사용될 데이터를 새로 만들어서 이를 전송하는 과정은 하나의 과정!
33. 중간 점검: 렌더링 성능의 주요 인자
1. GPU는 회전/확대/축소/기울임/반투명 처리 등에 최적화
a. 이 범주의 기능으로 렌더링이 처리될 수 있도록
1. GPU에서 사용할 데이터를 준비하는 것은 CPU의 몫
a. CPU가 새로운 데이터를 만드는 작업은 최소화
1. CPU가 준비한 데이터는 비디오 메모리에 전송 필요
a. 데이터의 전송을 최소화할 수 있도록...
36. 크롬의 렌더링
1. 웹 페이지는 파싱을 통해 DOM 트리로 해석되어 메모리에 적재
2. DOM 트리를 렌더링 트리로 생성 후 각 노드들을 개별적인 이미지로 생성
3. 트리 구조 및 스타일에 따라 이미지를 배치 및 합성하여 출력
37. 레이어 모델
레이어(Layer)?
웹페이지를 렌더링하기 위해 필요한 이미지 단위의 요소
● 각 레이어는 최종적으로 표현될 이미지를 생성하는 단
위
● 생성된 이미지는 텍스쳐로서 GPU에 업로드
● 레이어들을 배치/합성하여 최종적인 웹페이지 표현
NOTE!
● 레이어의 이미지는 CPU에서 생성!
o 즉, 레이어에서 생성되는 이미지는 CPU 시간 소
모!
4개의 레이어로 이루어진 웹 페이지
의 예
39. ● Reflow = Layout = Layouting
o DOM 노드가 가지는 레이아웃 정보(Geometry)가 변
경되면 레이아웃은 재배치를 위한 계산이 필요
이슈: Reflow
Header
DIV
Footer
Header
DIV
Footer
40. 이슈. Reflow로 발생할 수 있는 일
Node Node
Node
Node
Node#A
Node
Node#A
{
border: 30px;
}
Invalidate Invalidate
Invalidate
1. 레이아웃의 변경이 트리를 따라 전파 (CPU)
2. 많은 경우 레이어 이미지의 갱신 필요 (CPU)
3. 레이어 이미지가 변경되면 VRAM의 텍스쳐 갱신 필요 (RAM to VRAM Bandwidth!!!)
INVALIDATE!!
41. ● Repaint = Redraw
o 레이아웃 내 컨텐츠가 변경 시 텍스쳐를 새로 생성 필
요
이슈: Repaint
데이터
CPU
2 VRAM
GPU
1
3
렌더
링
이 그림 기억하십니까?
42. 이슈: Reflow/Repaint 발생 요인
● DOM 노드의 동적인 추가/삭제/업데이트
● DOM 노드의 감춤/표시
o display: none
o visibility: hidden
● DOM 노드의 이동, 애니메이션
● 스타일시트의 추가 혹은 스타일 속성의 변경
o 미디어 쿼리 역시
● 브라우저 사이즈 변경
● 폰트 변경
● 스크롤
● …
44. 정리: 크롬에서의 전반적인 렌더링 흐름
1. DOM으로부터 노드들을 개별적으로 혹은 그룹 지어 레이어 단위들로 분리
2. 레이아웃을 계산하고 각 레이어들이 그려져야 할 영역의 크기 위치 등을 계
산
a. 위치/크기 정보 등을 계산하기 위한 CPU의 계산 오버헤드가 발생
3. 레이어들 각각은 렌더링을 위해 비트맵으로 출력
a. CPU에서 레이어 이미지를 생성하는 오버헤드가 발생
4. 생성된 비트맵을 GPU에 텍스쳐로 업로드
a. GPU의 비디오 메모리로 전송하는 오버헤드는 발생
5. 계산된 레이아웃으로 레이어의 텍스쳐 이미지들을 최종 스크린 이미지로
합성
46. ● 네이티브 어플리케이션 관점:
o 최대한 가벼운 렌더링 프로세스의 구성이 목적
> 3D 혹은 2D 게임 개발의 예
“이번 게임은 꽤 그래픽 출력이 많기 때문에 CPU와 GPU 사이의 병목 구간
을 최소화할 수 있도록 텍스쳐의 생성/업로드를 병목 구간 전에 미리 처리
하고, 텍스쳐 캐싱 정책을 블라블라한 모델에 따라 관리하도록 모듈
을 !@#!@$ 하게 작성합니다.
또한 우리 게임에서 특별하게 발생할 몇몇 상황에도 이러한 렌더링 모듈에
대한 커스텀 구현으로 이를 회피할 방법을 찾을 수 있을 것입니다.” - A개발
최적화에 대한 그래픽 모듈의 구현 관점
47. ● 빠른 렌더링 패스를 구현하는 것이 아니다!!!
o 렌더링 패스는 철저하게 브라우저의 영역
o 웹 렌더링 성능 최적화는 만드는 것이 아니라 병목 구
간의 발생 요인을 피해가는 것!
● 피해야 할 성능의 위험 인자
o CPU에서 텍스쳐 이미지를 생성하는 요인들
o 가급적이면 레이아웃 변경의 요인도!!
웹 페이지에서의 렌더링 최적화는...
48. 크롬에서 DOM 노드가 레이어로 분리되는 조건들
1. 3D 혹은 Perspective를 표현하는 CSS transform 속성을 가진 경우
2. 하드웨어 갶속 디코딩을 사용하는 <video> 엘리먼트
3. 3D 컨텍스트 혹은 하드웨어 갶속 2D 컨텍스트를 가지는 <canvas> 엘
리먼트
4. (플래시와 같은) 플러그인 영역
5. 투명도(opacity) 속성 혹은 transform 애니메이션의 사용
6. 갶속 가능한 CSS 필터를 가진 경우
7. Compositing Layer를 하위 노드로 가진 경우
8. 낮은 z-index를 가진 형제 노드가 Compositing Layer를 가진 경우
가장 간단한 Hack: 레이어의 분리
49. 분리 조건 요약: 해당 DOM 노드가 주변 노드와는 별도로 렌더링되어야 빠른 경
우
예1> 투명도(Opacity): 겹쳐진 다른 이미지와 픽셀 단위의 블렌딩(Blending)되는
경우. 하지만 애니메이션에서만 성능 이슈가 발생하므로 애니메이션일 경우만
분리
예2> 매번 표시되는 프레임이 변경되는 <video> 엘리먼트.
개발자의 Hack! translateZ(0);
● translateZ(0);는 노드의 Z축 값으로 0을 주는 무의미한 코드
● 그러나 레이어 분리 조건의 첫번째 항목에 해당
가장 간단한 Hack: 레이어의 분리
50. 강제적인 레이어 분리가 만능은 아니다!
● 왜?
o 레이어 분리는 필연적으로 텍스쳐 이미지 분리를 의미
추가적인 메모리 소모
o 메모리는 유한하다!
메모리 공간 부족 시 기존 데이터 릴리즈 후 새로운 데이터의 업로
드
● 최악의 경우가 반복되면...
레이어 분리를 통한 성능 이점을 송수신 오버헤드로 상쇄
● 따라서, 레이어 분리는 최소화 필요!!!
51. 하드웨어 갶속으로 얻는 성능은
절대로 공짜가 아님! :)
모든 것에 가능성을 두고 확인!