Skip to content

satoru-takeuchi/inline-vs-macro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inline-vs-macro

Compare the build time between inline function and macro

Implement simple swap() routine with both inline function and macro. Comparing the build time of the two programs which calls swap() 0, 100, 200, ...10000 times. One uses inline version, the other uses macro version.

How to run

$ make run
$ 

Result is as inline.result and macro.result. Their format is <# of calls>¥t<time[s]> for each line.

Sample result

gcc

alt text

clang

alt text

gcc and clang

alt text

About

Compare the build time between inline function and macro

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published