David Hozic

Results 16 comments of David Hozic

audioop: ![image](https://github.com/Pycord-Development/pycord/assets/25441182/c670172e-14ab-45bb-8953-427cf2b17326) Without audioop: ![image](https://github.com/Pycord-Development/pycord/assets/25441182/e2a197c6-8566-4adb-87b7-add0bfa29788) Hardware: OS Name Microsoft Windows 10 Pro Processor AMD Ryzen 5 5600X 6-Core Processor, 3701 Mhz, 6 Core(s), 12 Logical Processor(s)

There, it's faster now: ![image](https://github.com/Pycord-Development/pycord/assets/25441182/bf27698a-71ef-4c22-902b-e801972b79b5)

With time.perf_counter_ns() pure Python: ![image](https://github.com/Pycord-Development/pycord/assets/25441182/26359ad7-c4be-4553-9347-26d609737482) audioop: ![image](https://github.com/Pycord-Development/pycord/assets/25441182/d4ffc3b9-1b4e-471b-8c56-5b52530cf8d1)

```py def timeit(f: Callable, ): def wrapper(*args, **kwargs): start = time.perf_counter_ns() result = f(*args, **kwargs) print(f"Elapsed: {(time.perf_counter_ns() - start)} ns") return result return wrapper ``` for anyone trying to benchmark:...

I can rewrite it in C as a actual python module if you'd like, possible compile it first with cython and then optimize? However if you want this to be...

CPU running at 1 GHz, latest changes: ![image](https://github.com/Pycord-Development/pycord/assets/25441182/9365a06c-53ce-464c-8c6d-daac30212b13) I think this should be more than enough optimized, since this function reads 20ms of audio.

R5 5600x 4.7 GHz ``` Elapsed: 31819500 ns Elapsed: 1016100 ns Elapsed: 868800 ns Elapsed: 739800 ns Elapsed: 897400 ns Elapsed: 743300 ns Elapsed: 732200 ns Elapsed: 784500 ns Elapsed:...

> With some guidance I could attempt a fix as I'm not very familiar with pycord's codebase. > > Please correct me if I'm wrong, but in the case of...

> @davidhozic The other Client classes reuse Client's implementation of _schedule_event, am I wrong? @Dorukyum Sure, made a pr 👍 From what I can tell, yes.