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

[Feature] Recognize to Rust Language #78

Closed
dotX12 opened this issue Dec 20, 2023 · 1 comment
Closed

[Feature] Recognize to Rust Language #78

dotX12 opened this issue Dec 20, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dotX12
Copy link
Collaborator

dotX12 commented Dec 20, 2023

Recognize from Python to Rust

Currently, active work is underway to unload the processor; searching for a signature is a complex operation for the CPU, especially for a language where there is an asynchronous approach, because of this, asynchrony for the recoginze method disappears.
What has already been done:
The search for song signatures from Python to Rust has been rewritten.
integration of this module through pyo3, as is done with pydantic.

There is very little left, but now you can see the preliminary results.

Before

Test for 20 iterations.

async def main():
    shazam = Shazam()
    t = time.perf_counter()
    a = await asyncio.gather(*[shazam.recognize_song("data/dora.ogg") for _ in range(20)])  # blocking code
    t2 = time.perf_counter()
    print(t2-t)

loop = asyncio.get_event_loop_policy().get_event_loop()
loop.run_until_complete(main())
>>> 23.145966300013242

After:

Test for 50 iterations.

async def main():
    sender = rust.Recognizer()
    t = time.perf_counter()
    a = await asyncio.gather(*[sender.recognize_path("data/dora.ogg") for _ in range(50)])
    t2 = time.perf_counter()
    print(t2 - t)
>>> 2.246784299990395
@dotX12 dotX12 added the enhancement New feature or request label Dec 20, 2023
@dotX12 dotX12 self-assigned this Dec 20, 2023
@dotX12
Copy link
Collaborator Author

dotX12 commented Feb 23, 2024

#76 (comment)

@dotX12 dotX12 closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant