Malmö University Publications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Förgreningsfria optimeringsmöjligheter för modern hårdvara
Malmö University, Faculty of Technology and Society (TS).
Malmö University, Faculty of Technology and Society (TS).
2020 (Swedish)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [sv]

Traditionellt fokuserar algoritmanalys på tidskomplexitet där alla individuella instruktioner förmodas ta likvärdig “konstant” tid. Men med modern hårdvara går det att både kasta om ordningen på instruktioner (out-of-order-exekvering) och utföra dem parallellt (pipelining) vilket ändrar förutsättningarna för vad som kan betraktas som effektiv kod. I rapporten identifieras bitvisa operationer och conditional moves som två möjliga förgreningsfria tekniker. Möjligheterna att nå prestandaförbättringar genom att använda dessa tekniker undersöks med experiment där förgreningsfri kod jämförs med traditionell kod. Experimenten utförs på både enkla rutiner och sorteringsalgoritmer för att ta reda på om det blir någon skillnad i exekveringstid med de olika teknikerna. Resultatet tyder att man kan finna vissa vinster i exekveringstid med rätt förutsättningar. Vilken typ av data som rutinerna arbetar med, branch predictors förmåga att göra kvalificerade gissningar och kostnaden för de extra instruktioner som förgreningsfria kod innebär är avgörande faktorer. Dessutom är det avgörande att kompilatorn faktiskt lyckas utföra de optimeringar som conditional moves förlitar sig på.

Abstract [en]

Traditionally, algorithmic analysis focuses on time complexity where all individual instructions are assumed to take equal "constant" time. But with modern hardware it is possible to both reorder instructions (out-of-order execution) and execute them in parallel (pipelining) which changes the conditions for what can be regarded as effective code. The report identifies bitwise operations and conditional moves as two possible branch-free techniques. The possibilities of achieving improved performance through these techniques is investigated by experiments comparing branch-free code with traditional code. The experiments are performed on both simple routines and more advanced sorting algorithms to evaluate if these techniques will lead to a difference in execution-time. The results suggest that certain performance gains can be found in execution time with the right conditions. The type of data that the routines work with, the branch predictor's ability to make qualified guesses, and the cost of the extra instructions that branch-free code entails, are crucial factors. In addition, it is crucial that the compiler actually succeeds in performing the optimizations that conditional moves rely on.

Place, publisher, year, edition, pages
Malmö universitet/Teknik och samhälle , 2020. , p. 29
Keywords [sv]
förgreningfri, algoritm, branch free, algorithm, bithacks
National Category
Engineering and Technology
Identifiers
URN: urn:nbn:se:mau:diva-20910Local ID: 32085OAI: oai:DiVA.org:mau-20910DiVA, id: diva2:1480794
Educational program
TS Systemutvecklare
Supervisors
Examiners
Available from: 2020-10-27 Created: 2020-10-27Bibliographically approved

Open Access in DiVA

fulltext(582 kB)116 downloads
File information
File name FULLTEXT01.pdfFile size 582 kBChecksum SHA-512
34b2b4a55239fccce124f310515a4211677ef5f05d1a6ceb687b7466145415291b1e25b75207e4745ddb3f12eab65d0b12af77a785c9115c9aa01fc32e879171
Type fulltextMimetype application/pdf

By organisation
Faculty of Technology and Society (TS)
Engineering and Technology

Search outside of DiVA

GoogleGoogle Scholar
Total: 116 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 115 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf