Skip to content

dsps_dotprod_f32 is slow on first call (examples/dotprod) (DSP-121) #78

Open
@Bobobel

Description

@Bobobel

Environment

  • Development Kit: [ESP32S3-Box-3]
  • Espressif IDF version [1.6.5] and IDF [5.1.2]
  • Build System: [CMake]
  • Compiler version xtensa-esp32s3-elf
  • Operating System: [Windows]
  • Power Supply: [USB]
  • I used DSP optimization as well as compiler opt -O2 (thanks, that this is possible with S3)

Problem Description

That example includes some bugs!
I fixed them (producing a sum of squares) and checked for other input as well as repeated timings:

Results:

I (1422) main: Start Example.
I (1422) main: The sum of N squares from 1 to N=256 = 5625216.000000 (reference=5625216)
I (1432) main: Operation for N samples take 2639 cycles
I (1432) main: End Example.
I (1432) main: The sum of N squares from 1 to N=256 = 5625216.000000 (reference=5625216)
I (1442) main: Operation for N samples take 429 cycles
I (1452) main: End Example.

Then I increased N to get (only second reading):
1581 cycles for N=1024 , factor=3.68
3117 cycles for N=2048 , factor=7.39
6189 cycles for N=4096 , factor=14.43
Fine, it is scaling as expected.

Expected Behavior

Maybe you can decrease setup time for first call of that routine? I guess it will not pay because usually dotprod will be called repeatedly.

Actual Behavior

Steps to repropduce

just double the test in main

"It is not a fault its a feature" (:->

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions