انتقل إلى المحتوى
أمين أبوزيد
SRC-016

هندسة الأداء

  • 8 درس
  • 4.5 ساعة تدريب (تقدير)
في هذه الصفحة 9 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • التحليل (Profiling)
  • تصميم الاختبارات المعيارية (benchmarks)
  • إزالة الاختناقات

تعلّم أولًا

4.5 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Design benchmarks (JMH for code, load tests for systems) that measure what matters and avoid common traps.
  2. Remove bottlenecks in order of impact and stop when the target is met.
  3. Detect performance regressions in CI.
  4. Communicate performance results with uncertainty and context.

الدروس

  1. 01عملية هندسة الأداء
  2. 02اختبارات معيارية دقيقة (Microbenchmarks) مع JMH
  3. 03اختبارات معيارية للنظام تتنبأ بالإنتاج
  4. 04إزالة الاختناقات بالترتيب
  5. 05اكتشاف الانحدار في CI
  6. 06الإبلاغ عن النتائج بصدق
  7. 07عرض عملي: خفض p99 لمسار الدفع إلى النصف بالأدلة
  8. 08عرض عملي: اختبار JMH كاذب ونسخته المصححة

المختبر والتمارين

Lab

SRC-016-LAB1 · Meet the latency target

Outcomes: 1–4 · Time: ~4.5 h Bring checkout p99 within the SLO at 10× forecast load. Baseline with a constant-rate load test, profile, remove bottlenecks in order, and stop at the target. Add a performance regression check to CI, then seed a regression. Acceptance: before/after evidence; CI catches a seeded regression.

Exercises (assessment: performance report review)

IDOutcomeTask
SRC-016-EX011Review a JMH benchmark with an unused result and constant input; list the traps and rewrite it.
SRC-016-EX021Design a load test plan for checkout at 1×, 5×, and 10× forecast: workload mix, arrival model, duration, pass criteria.
SRC-016-EX032Given a table of step shares of p99 (45, 25, 15, 10, 5), choose the order of work and the likely maximum gain from the first fix.
SRC-016-EX043Design the CI regression check: benchmark set, baseline, tolerance, failure behavior.
SRC-016-EX054Rewrite "p99 improved from 800 ms to 400 ms" as an honest report line with context and uncertainty.
SRC-016-EX062Case: the team wants to rewrite the JSON library to save 3% of checkout time. Give your recommendation.
أظهر الحلول
  • EX01 Traps: dead-code elimination and constant folding. Consume via Blackhole or return, use @State inputs with variety, add forks, warm-up and measurement.
  • EX02 Mix by real traffic proportions, constant arrival rate, steps, long enough for steady state, pass if p99 and error rate meet the SLO at 10×.
  • EX03 Order by share; the first fix at 45% could remove up to 45% at best; re-measure after each since shares change.
  • EX04 Small stable JMH subset plus a smoke load test on dedicated hardware; compare with main baseline; tolerance from measured noise; fail with a report.
  • EX05 For example: "Checkout p99 fell from 800 ms (95% CI 780 to 820) to 400 ms (385 to 415) over five 20-minute runs at 10× forecast, on the staging environment with stubbed payment latency; production may differ in cache hit rates."
  • EX06 Decline: even removing it entirely gains at most 3%; spend effort on the largest remaining bottleneck.
  • Outcome 3 is also covered by the lab CI check and Q07-Q08; outcome 4 by Q10.

Workplace evidence: a measured performance improvement you delivered.

الاختبار

Outcomes: O1 benchmark design · O2 bottleneck removal · O3 CI regression detection · O4 reporting.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1JMH is used to:O1
  2. 2A benchmark whose result is unused may be:O1
  3. 3Why prefer a constant arrival rate in load tests?O1
  4. 4A system benchmark needs:O1
  5. 5The first fix should target:O2
  6. 6If a step is 5% of time, eliminating it gains at most:O2
  7. 7Regression checks in CI should compare against:O3
  8. 8Benchmarks in CI should run on:O3
  9. 9When do you stop optimizing?O2
  10. 10An honest performance report includes:O4

الجزء العملي

Performance report review (SRC-016 assessment): critique a given report and present SRC-016-LAB1 evidence. Pass: at least 8/10 on the quiz, before/after results with variance, and a CI check that fails on a seeded regression.

أخطاء شائعة

JMH-free microbenchmarks; optimizing non-bottlenecks; single-run results.

التقييم

Performance report review.

دليل من بيئة العمل

A measured performance improvement you delivered.

الصلة بالمسار الوظيفي

Cost-performance optimization (SRA-007).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.