manekinekko / manekinekko/angular-web-bluetooth

Performance improvement

Open
#77 2 comments 0 reactions 0 assignees View on GitHub
help wanted question
Dominant language
TypeScript
Stars
199
Forks
62
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
We are seeing very slow response times using the library to write to a NUS serial service tx characteristic. For example, using python with the bleak BLE library we are seeing around 7-10ms response times. For the same request using angular-web-bluetooth library we are seeing on average 300 - 400ms response times. Our application requires many requests to load data from our devices so we would love to see similar performance to the python script.

**Describe the solution you'd like**
An improvement in the amount of time for the write subscription to return. Here is an example of a request we are making:
this.bluetooth.writeValue$(this.feritConnection.rx, slice)
.subscribe(() => { console.log("This on average takes around 300 - 400ms to return");};

**Additional context**
Cleaner screenshot of code we are using to write to the NUS serial service tx characteristic:

![angularBluetoothWriteRequestCode](https://user-images.githubusercontent.com/16090027/112916846-1a9df180-914d-11eb-88ce-36d4e3e3d717.png)

Definition of the NUS serial service:
![nusSerialSerrvice](https://user-images.githubusercontent.com/16090027/112917414-4a012e00-914e-11eb-868b-4493f1e107c9.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the implementation of writeValue$ and trace the Web Bluetooth write path used for the NUS serial service tx characteristic. Measure the latency of the shown writeValue$ request, identify where the delay occurs, and verify that the callback returns substantially faster without breaking the write flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.