Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!!! #2

Open
beryll1um opened this issue Jul 30, 2022 · 4 comments
Open

!!! #2

beryll1um opened this issue Jul 30, 2022 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@beryll1um
Copy link

learn C++ first so you don't have to write like that. A shame!!!

Linked: https://github.com/APoCpp/QMLTemplate/issues/1

@melonges
Copy link
Owner

learn C++ first so you don't have to write like that. A shame!!!

Linked: https://github.com/APoCpp/QMLTemplate/issues/1

IMG_20220730_033654.jpg

@beryll1um
Copy link
Author

beryll1um commented Jul 30, 2022

To teach you not to clog the issues of other projects, perhaps I'll give real important comments:

Using printf in cases where you don't need to format string - bad practice
https://github.com/mellonges/terminal-fps-checker/blob/ef0fc0da27fb02fba90e091b6fd04b321786a4c5/main.c#L27
https://github.com/mellonges/terminal-fps-checker/blob/ef0fc0da27fb02fba90e091b6fd04b321786a4c5/main.c#L33
https://github.com/mellonges/terminal-fps-checker/blob/ef0fc0da27fb02fba90e091b6fd04b321786a4c5/main.c#L35
https://github.com/mellonges/terminal-fps-checker/blob/ef0fc0da27fb02fba90e091b6fd04b321786a4c5/main.c#L49
https://github.com/mellonges/terminal-fps-checker/blob/ef0fc0da27fb02fba90e091b6fd04b321786a4c5/main.c#L50

Compiler doesn't optimizing printf in puts, if the last printable is not
'\n'. You must use fputs.

Please check:

gcc -O3 main.c
objdump -M x86-64 -j .text -d a.out

You mentioned that you are a performance optimization engineer at Intel, but such mistakes are a shame for you as a specialist.

@melonges melonges added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 30, 2022
@melonges melonges reopened this Aug 20, 2022
@melonges
Copy link
Owner

Я исправил на fputs и результат тот же

@beryll1um
Copy link
Author

beryll1um commented Aug 21, 2022

main.1.c.txt
objdump.1.txt
main.2.c.txt
objdump.2.txt

Please look around 144 line in objdump output files =)

gcc -O3 main.c
objdump -M x86-64 -j .text -d a.out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants