Files
2nd/10_Wiki/Topic_Programming/Frontend/전력 시스템(Power Systems).md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

5.3 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-전력-시스템-power-systems 전력 시스템 (Power Systems) — 프론트엔드 관점 10_Wiki/Topics verified self
Battery API
Power-aware UI
Energy efficiency
none A 0.85 applied
frontend
performance
battery
mobile
energy
2026-05-10 pending
language framework
JavaScript Web APIs

전력 시스템 (Power Systems) — 프론트엔드 관점

매 한 줄

"매 mobile / laptop 의 battery 와 thermal budget 을 의식하는 frontend". 2026 매 user 의 80%+ 가 mobile 매 access — 매 60fps 의 X, 매 power-aware design 이 differentiator. Battery API deprecation 후 매 alternative signal (visibility, network, thermal) 활용.

매 핵심

매 power consumer (frontend)

  • CPU/JS: 매 long task, 매 layout thrash, 매 polling.
  • GPU: 매 unnecessary compositing, 매 large canvas, 매 video decode.
  • Network/radio: 매 frequent fetch, 매 large payload, 매 keep-alive.
  • Display: 매 bright pixels, 매 high refresh rate.
  • Sensors: GPS, accelerometer, camera 매 always-on.

매 power-aware signals

  • Page Visibility API: 매 hidden 시 매 work 중단.
  • prefers-reduced-motion: 매 animation 축소.
  • Network Information API: 매 'slow-2g' / 'saveData' 감지.
  • deprecated Battery API: Chrome 84+ removed — 매 indirect signal 의존.

매 응용

  1. Background tab 매 timer/animation 정지.
  2. Save-data mode 매 image/video 축소.
  3. requestIdleCallback 매 non-critical work 의 deferral.

💻 패턴

Page Visibility — 매 hidden 시 정지

let rafId = null;

function tick() {
  // 매 expensive animation
  draw();
  rafId = requestAnimationFrame(tick);
}

document.addEventListener('visibilitychange', () => {
  if (document.hidden) {
    cancelAnimationFrame(rafId);
    rafId = null;
  } else if (!rafId) {
    rafId = requestAnimationFrame(tick);
  }
});

Save-Data — 매 light mode

function getDataSaverMode() {
  const conn = navigator.connection || navigator.mozConnection;
  if (!conn) return false;
  return conn.saveData === true ||
    ['slow-2g', '2g'].includes(conn.effectiveType);
}

if (getDataSaverMode()) {
  document.body.classList.add('lite-mode');
  // 매 disable autoplay video, large hero image, prefetch
}

prefers-reduced-motion

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
if (mq.matches) {
  // 매 expensive parallax, particle 매 비활성화
  disableParallax();
}

requestIdleCallback — 매 non-urgent work

function scheduleAnalytics(payload) {
  if ('requestIdleCallback' in window) {
    requestIdleCallback(() => sendBeacon(payload), { timeout: 2000 });
  } else {
    setTimeout(() => sendBeacon(payload), 0);
  }
}

function sendBeacon(payload) {
  navigator.sendBeacon('/analytics', JSON.stringify(payload));
}

Intersection Observer — 매 viewport 외 lazy

const io = new IntersectionObserver((entries) => {
  for (const e of entries) {
    if (e.isIntersecting) {
      const img = e.target;
      img.src = img.dataset.src;
      io.unobserve(img);
    }
  }
}, { rootMargin: '200px' });

document.querySelectorAll('img[data-src]').forEach((img) => io.observe(img));

매 throttle WebSocket on hidden

class PowerAwareSocket {
  constructor(url) {
    this.url = url;
    this.connect();
    document.addEventListener('visibilitychange', () => this.adjust());
  }
  connect() {
    this.ws = new WebSocket(this.url);
  }
  adjust() {
    if (document.hidden) {
      // 매 hidden — close to save radio
      this.ws.close();
    } else if (this.ws.readyState !== WebSocket.OPEN) {
      this.connect();
    }
  }
}

CSS — 매 dark mode 매 OLED 절전

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; /* 매 true black 매 OLED 의 pixel off */
    --fg: #e8e8e8;
  }
}

매 결정 기준

상황 Approach
매 background tab requestAnimationFrame 정지
매 save-data image quality 축소, prefetch X
매 reduced-motion animation 비활성화
매 idle requestIdleCallback
매 OLED + dark mode true black bg

기본값: visibility + saveData + reduced-motion 의 3개 매 mandatory.

🔗 Graph

🤖 LLM 활용

언제: 매 power profile audit, 매 power-aware UX 추천. 언제 X: 매 actual battery measurement (impossible from JS).

안티패턴

  • 항상 60fps animation: 매 background tab 도 — 매 battery drain.
  • polling 5s: 매 mobile radio 매 always-on — push 또는 long-poll.
  • autoplay video 4K: 매 cellular 매 data + battery.

🧪 검증 / 중복

  • Verified (MDN Page Visibility, Network Information, Web.dev power).
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — power-aware frontend, visibility/saveData/reduced-motion 패턴