• Nem Talált Eredményt

Ideas for Improving Efficiency of Procedural Abstraction

N/A
N/A
Protected

Academic year: 2022

Ossza meg "Ideas for Improving Efficiency of Procedural Abstraction"

Copied!
13
0
0

Teljes szövegt

(1)

UNIVERSITAS SCIENTIARUM SZEGEDIENSIS

UNIVERSITY OF SZEGED

D epartment of Software Engineering

Ideas for Improving Efficiency of Procedural Abstraction

Tamás Szirbucz

(2)

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 2

Procedural abstraction

(3)

Single Entry -Single Exit

 Advantages:

■ Less overhead

■ More abstractable code parts

 Disadvantages:

■ Higher computing complexity

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 3

(4)

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 4

Procedural abstraction

 Find equivalent sequences in the code

 Remove them except one

 Store the return address and insert a jump in place of removed sequences.

 Insert indirect jump to the end of this

sequence

(5)

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 5

Single Entry – Single Exit

(6)

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 6

Single Entry – Single Exit

(7)

Jun 29, 2012 Ideas for Improving Efficiency of Procedural Abstraction 7

Variable renaming

a = 1;

b = 3;

D.3251 = b * 2;

x = D.3251 + a;

D.3252 = (const char * restrict) &"%d\n"[0];

printf (D.3252, x);

D.3253 = 0;

return D.3253;

p = 1;

q = 3;

D.3251 = q * 2;

r = D.3251 + p;

D.3252 = (const char * restrict) &"%d\n"[0];

printf (D.3252, r);

D.3253 = 0;

return D.3253;

(8)

Variable renaming

 Advantages:

■ More abstractable sequences

 Disadvantages:

■ Higher computing cost

■ Higher overhead (2 assigns per renamings)

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 8

(9)

Choosing strategy

 Current: The one with the most gain.

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 9

(10)

Choosing strategy

 Is this strategy more optimal, than choose the longest one?

 |A| * n + |B| * (m – n + 1) < |B| * m ?

|A| * n < |B| * (n - 1) ?

 It is not.

Jun 29, 2012 Ideas for Improving Efficiency of Procedural Abstraction 10

(11)

Choosing strategy

 Is this strategy more optimal, than choose the longest one?

 |A| * n + |B| * (m – n + 1) < |B| * m ?

|A| * n < |B| * (n - 1) ?

 It is not.

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 11

(12)

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 12

Thanks for your patience!

(13)

Acknowledgement

The presentation is supported by the European Union and co-funded by the European Social Fund.

Project title: “Broadening the knowledge base and supporting the long term professional sustainability of the Research University Centre of Excellence at the University of Szeged by ensuring the rising

generation of excellent scientists.”

Project number: TÁMOP-4.2.2/B-10/1-2010-0012

Jun 30, 2012 Ideas for Improving Efficiency of Procedural Abstraction 13

Hivatkozások

KAPCSOLÓDÓ DOKUMENTUMOK

b Materials and Solution Structure Research Group and Interdisciplinary Excellence Centre, Institute of Chemistry, University of Szeged, Aradi Vértanúk tere 1, Szeged,

Major research areas of the Faculty include museums as new places for adult learning, development of the profession of adult educators, second chance schooling, guidance

The decision on which direction to take lies entirely on the researcher, though it may be strongly influenced by the other components of the research project, such as the

By examining the factors, features, and elements associated with effective teacher professional develop- ment, this paper seeks to enhance understanding the concepts of

Project title: “Broadening the knowledge base and supporting the long term professional sustainability of the Research University Centre of Excellence at the University of Szeged

• Project title: “Broadening the knowledge base and supporting the long term professional sustainability of the Research University Centre of Excellence at the University of Szeged

Project title: “Broadening the knowledge base and supporting the long term professional sustainability of the Research University Centre of Excellence at the University

Project title: “Broadening the knowledge base and supporting the long term professional sustainability of the Research University Centre of Excellence at the University of Szeged