Performance Optimization

First of all, we must divide the process of into seven phases:

  1. We need to customize our Delphi compiler and for . Furthermore, we need to familiarize ourselves with the itself we’re targeting.
  2. We must identify bottlenecks, using Turbo or another profiling or . We will examine tools to measure the number of times a statement block is executed, and several methods of timing these . may be statements, but also procedures, functions, units and whole programs. We can find the using these techniques. It will turn out that even small improvements in these bottlenecks will often have more effect than big improvements in non-bottle-.
  3. We should examine the of the bottlenecks found in step 2, and try to find more efficient equivalents. We will see that the largest can come from changing . A more to a problem might be less flexible, but can often be an order of a magnitude faster!

After we performed the first four or , we know for certain that the (stand-alone!) executable (EXE, DLL, OCX) is as fast as possible. Yet, this doesn’t mean that the ’t need fine-tuning. Especially in a Client/Server, or N-tier (internet) environment, we need to perform additional steps to ensure maximum efficiency.
During the Delphi Efficiency session in San Diego, we’ll spend some time exploring steps 6. and 7. by building a 2-Tier , using TClientDataSet and Providers.

27 views

27 AÄŸustos 2010
Okunma 27
bosluk

Ağ sürücülerinin Tespiti

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public

2 views

17 Mart 2009
Okunma 2
bosluk

Tablodan dosyaya aktarma

unit Exttab;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,dialogs,
Db, DBTables,StdCtrls,ComCtrls,WinTypes, WinProcs, ExtCtrls,DBCtrls;

const
LANGUAGE=’TURKISH’;
REGISTERED=FALSE;

type
TExtTab= class(Ttable)
private
{ Private declarations }
f_message:string;
f_about:string;

3 views

17 Mart 2009
Okunma 3
bosluk

Aranan alan tabloda var mı?

Function IsField(DatabaseName, TableName, FieldName: String): Boolean;
Var
Query : TQuery;
T : TTable;
i : Integer;
UpperFN : String;
TestFN : String;
Begin
Result := False;
UpperFN := UpperCase(FieldName);
If Not IsTable(DatabaseName, TableName) Then Exit;
Query := TQuery.Create(nil);
T := TTable.Create(nil);
Try
Try
Query.DatabaseName := DatabaseName;
Query.Sql.Clear;
Query.Sql.Add(‘Select ‘);

10 views

17 Mart 2009
Okunma 10
bosluk

Bir tablo alanındaki değerlerin sağ tarafındaki boşlukların temizlenmesi

Function DBTrimBlanksRight(
DatabaseName : String;
TableName : String;
FieldName : String): Boolean;
Var
Q : TQuery;
S : String;
Begin

1 views

17 Mart 2009
Okunma 1
bosluk

Tablo yapıları aynı mı?

Bu fonksiyonda, iki tablonun yapisi karsilastirilir ve ayni ise TRUE degeri döndürülür.
Function DBSchemaSame(const
DatabaseName1,
Table1,
DatabaseName2,
Table2: string): Boolean;
Begin
Result :=

3 views

17 Mart 2009
Okunma 3
bosluk

Tablo adının değiştirilmesi

Function DBReNameTable(
DatabaseName,
TableNameOld,
TableNameNew: String): Boolean;
Begin
Result := True;
Try
If Not IsTable(DatabaseName, TableNameOld) Then
Begin
Result := False;
Exit;
End;

{First Copy The Source Table To The New Table}
If Not DBCopyTable(
DatabaseName,
TableNameOld,
DatabaseName,
TableNameNew) Then
Begin
Result := False;
Exit;

5 views

16 Mart 2009
Okunma 5
bosluk

Tablonun anahtar alanların tespiti

Function DBKeyFieldNamesToTStrings(
DatabaseName : String;
TableName : String;
Strings : TStrings): Boolean;
Var
Table : TTable;
FieldNo : Integer;
Begin
Result := False;
If Not IsTable(DatabaseName, TableName) Then Exit;
Table := TTable.Create(nil);
Try

9 views

16 Mart 2009
Okunma 9
bosluk

Tabloda Alan tiplerinin bulunması

Function TypeField(DatabaseName, TableName, FieldName: String): String;
Var
Table : TTable;
FieldIndex : Integer;
FieldType : TFieldType;
Begin
Result := ”;
If Not IsTable(DatabaseName, TableName) Then Exit;
If Not IsField(DatabaseName, TableName, FieldName) Then Exit;
Table := TTable.Create(nil);
Try
Try
Table.Active := False;
Table.DatabaseName := DatabaseName;
Table.TableName := TableName;
Table.Active := True;
FieldIndex :=
Table.FieldDefs.IndexOf(FieldName);
FieldType :=
Table.FieldDefs[FieldIndex].DataType;

8 views

16 Mart 2009
Okunma 8
bosluk

Tabloda Alan uzunluğunun bulunması

Tablo içerisindeki bir alanın, uzunluğu, bu fonksiyon ile bulunur.

Function DBFieldSize(DatabaseName, TableName, FieldName: String): Integer;
Var
Table : TTable;
FieldIndex : Integer;
FieldSize : Integer;
Begin
Result := 0;
If Not IsTable(DatabaseName, TableName) Then Exit;
If Not IsField(DatabaseName, TableName, FieldName) Then Exit;
Table := TTable.Create(nil);
Try
Try
Table.Active := False;
Table.DatabaseName := DatabaseName;
Table.TableName := TableName;
Table.Active := True;
FieldIndex :=

2 views

16 Mart 2009
Okunma 2
bosluk
 Son Yazılar FriendFeed

Tavsiye Bağlantılar