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

Performance Optimization: replace flag checks with macros. #17

Merged
merged 3 commits into from
Feb 16, 2021
Merged

Conversation

soasme
Copy link
Owner

@soasme soasme commented Feb 16, 2021

This should reduce the number of execution instructions for issue 15.

--------------------------------------------------------------------------------
Ir
--------------------------------------------------------------------------------
401,588,183 (100.0%)  PROGRAM TOTALS

--------------------------------------------------------------------------------
Ir                    file:function
--------------------------------------------------------------------------------
345,401,053 (86.01%)  peppapeg.c:P4_NeedLoosen [/app/a.out]
 25,019,000 ( 6.23%)  peppapeg.c:P4_NeedSquash [/app/a.out]
  4,617,160 ( 1.15%)  ???:_int_free [/usr/lib64/libc-2.28.so]
  3,382,226 ( 0.84%)  ???:malloc [/usr/lib64/ld-2.28.so]
  2,595,108 ( 0.65%)  peppapeg.c:P4_Match'2 [/app/a.out]
  1,848,485 ( 0.46%)  ???:free [/usr/lib64/ld-2.28.so]
  1,841,351 ( 0.46%)  peppapeg.c:P4_MatchLiteral [/app/a.out]
  1,712,968 ( 0.43%)  ???:__strlen_avx2 [/usr/lib64/libc-2.28.so]
  1,705,988 ( 0.42%)  peppapeg.c:P4_MatchChoice'2 [/app/a.out]
  1,518,598 ( 0.38%)  peppapeg.c:P4_Expression_dispatch'2 [/app/a.out]
  1,260,936 ( 0.31%)  ???:strdup [/usr/lib64/ld-2.28.so]
  1,098,095 ( 0.27%)  peppapeg.c:P4_MatchRepeat [/app/a.out]
  1,092,247 ( 0.27%)  peppapeg.c:P4_RaiseError [/app/a.out]
  1,016,618 ( 0.25%)  ???:__memcpy_avx_unaligned_erms [/usr/lib64/libc-2.28.so]
    865,496 ( 0.22%)  peppapeg.c:P4_MatchSequence'2 [/app/a.out]
    806,160 ( 0.20%)  peppapeg.c:P4_RescueError [/app/a.out]
    791,322 ( 0.20%)  peppapeg.c:P4_GetPosition [/app/a.out]
    671,409 ( 0.17%)  peppapeg.c:P4_DeleteToken [/app/a.out]
    470,520 ( 0.12%)  peppapeg.c:P4_PushFrame [/app/a.out]

Before PR:

# time ./a.out
real    0m0.090s
user    0m0.084s
sys     0m0.003s

PR:

real	0m0.052s
user	0m0.048s
sys	0m0.001s

@soasme soasme merged commit dee2faf into main Feb 16, 2021
@soasme soasme deleted the issue-15-2 branch February 16, 2021 10:49
@soasme
Copy link
Owner Author

soasme commented Feb 16, 2021

#15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant