Performance Tuning for Linux Servers [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Performance Tuning for Linux Servers [Electronic resources] - نسخه متنی

Sandra K. Johnson

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Code Tuning


Entire books have been written concerning good programming practices. We will simply present some highlights in the following list for the application developer to consider, especially in light of the preceding advice on "helping" the compiler "see" where optimizations can be most effective:

Put the most common statement first when using multiple tests.

Avoid unnecessary type conversions (implicit ones as well).

Minimize the amount of code actually inside a loop.

Minimize the number of expensive operations in a loop (divides, for example). In fact, it would pay to obtain texts specifically about the subject of tuning loops if this is where your bottlenecks reside. A large amount of research is available on the subject.

Inline short subroutines.

Keep the number of parameters low in subroutines and functions.

Use already-tuned libraries of functions where possible instead of creating your own and reinventing the wheel.

Eliminate unnecessary I/O and keep I/O operations out of loops where possible.

Use parentheses in mathematical expressions to help the compiler, and break complex expressions into simpler subexpressions that can be more easily optimized. Almost always, a better solution is using already-tuned math libraries.


As a reminder, clean, straightforward approaches to a coding problem typically result in the best optimizations and good performance coding practices. Another area to consider is your choice for design.


/ 227