Skip to content

module_adapter: inline some time critical functions - #7993

Closed
btian1 wants to merge 1 commit into
thesofproject:mainfrom
btian1:adapter_inline
Closed

btian1 wants to merge 1 commit into
thesofproject:mainfrom
btian1:adapter_inline

Conversation

@btian1

@btian1 btian1 commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

Those functions are only called once and in critical timing path, Inline would save the function parameter push/pull stack operation.

Those functions are only called once and in critical timing path,
Inline would save the function parameter push/pull stack operation.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
@dbaluta

dbaluta commented Jul 31, 2023

Copy link
Copy Markdown
Collaborator

Do, you have any data for this? This kind of optimizations need to be documented.

@btian1
btian1 marked this pull request as ready for review August 1, 2023 00:56
@btian1

btian1 commented Aug 1, 2023

Copy link
Copy Markdown
Contributor Author

is kind of optimizations need to be documented.

I do have, but it is in audio stream path, this is raw data path, it normally can save 5% or upper cycles with same test.

@lgirdwood lgirdwood left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@btian1 can you update the commit message to show perf improvement for some tested pipelines and any memory increase. Thanks

@btian1

btian1 commented Aug 2, 2023

Copy link
Copy Markdown
Contributor Author

@btian1 can you update the commit message to show perf improvement for some tested pipelines and any memory increase. Thanks

these are IADK modules, used by AMD, we have no way to perform a test, so can't collect data, I collected data from
audio stream copy, after removed function shell, around 3%-5% improve, check below link:
320b54b
@marcinszkudlinski , please also comment on this patch.

@lgirdwood

Copy link
Copy Markdown
Member

@btian1 can you update the commit message to show perf improvement for some tested pipelines and any memory increase. Thanks

these are IADK modules, used by AMD, we have no way to perform a test, so can't collect data, I collected data from audio stream copy, after removed function shell, around 3%-5% improve, check below link: 320b54b @marcinszkudlinski , please also comment on this patch.

ok, but what about code size impact ?

@btian1

btian1 commented Aug 2, 2023

Copy link
Copy Markdown
Contributor Author

@btian1 can you update the commit message to show perf improvement for some tested pipelines and any memory increase. Thanks

these are IADK modules, used by AMD, we have no way to perform a test, so can't collect data, I collected data from audio stream copy, after removed function shell, around 3%-5% improve, check below link: 320b54b @marcinszkudlinski , please also comment on this patch.

ok, but what about code size impact ?

I checked multiple times, seems there is no difference for inline and not inline, anything changed in compiler build options?

They are same with below for tgl build:
module: input size 668231 (0xa3247) bytes 35 sections
module: text 319959 (0x4e1d7) bytes
data 348272 (0x55070) bytes
bss 9312 (0x2460) bytes

Now, I don't have a justification to keep this PR.

@lgirdwood

Copy link
Copy Markdown
Member

I checked multiple times, seems there is no difference for inline and not inline, anything changed in compiler build options?

They are same with below for tgl build: module: input size 668231 (0xa3247) bytes 35 sections module: text 319959 (0x4e1d7) bytes data 348272 (0x55070) bytes bss 9312 (0x2460) bytes

Now, I don't have a justification to keep this PR.

Yeah, it looks like the compiler is doing the correct thing, not sure why you could see an perf difference, maybe rerun the test ?

@btian1

btian1 commented Aug 3, 2023

Copy link
Copy Markdown
Contributor Author

the result is from #7909 , #7909 need wait #7958 merge first, then I will have a check again.

@btian1 btian1 closed this Aug 3, 2023
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.

3 participants