dovigod / V-Gesture

Other
2 stars 0 forks source link

[Enhancement] - Add shared memory at gestureManager for boosting performance #22

Closed dovigod closed 3 months ago

dovigod commented 4 months ago

Start Date

2024/05/16

Summary

After Implementing GestureManager, I've found that whenever each gesture gets added, I will have its own unique calculations for determinator, which will lead crucial performance issue.

To deal with this issue, Im thinking of caching calculations and forward them whenever each plugin request it.

Basic Example


/// sample plugin
class SamplePlugin{
   constructor(){
       this.caculation = ['func::getDistance-thumbTip-indexTip', 'var::thumbTip','var::indexTip']  // concat, and make it as key for retreiving result

   }
}

/// sample gesture determinator

class Gesture{
   constructor(){

   }

  determinator(... , cached){
     const distanceBetweenThumbAndIndex = cached['getDistance-thumb-index'];

  }

}

Drawbacks

Nope, Its just kinda relocating of codes, so it won't make any drawbacks.

Implementation PR

23

Reference Issues

No response