open-spaced-repetition / ts-fsrs

ts-fsrs is a versatile package based on TypeScript that supports ES modules, CommonJS, and UMD.
https://open-spaced-repetition.github.io/ts-fsrs/
MIT License
216 stars 22 forks source link

about optimization #134

Closed asukaminato0721 closed 4 weeks ago

asukaminato0721 commented 1 month ago

I noticed that

undoing the review, and optimization (WIP).

I am working on nodejs binding for it, so you may use that :P

asukaminato0721 commented 1 month ago

for browser, wasm may be a choice, but burn-rs requires some effort to do that.

Since most use case is electron(nodejs) , I will assume nodejs is enough.

asukaminato0721 commented 1 month ago

done

https://github.com/open-spaced-repetition/fsrs-rs-nodejs

currently no npm

Size of FSRSItems: 500
Default parameters: [
  0.40255001187324524,   1.1838500499725342,
   3.1730000972747803,   15.691049575805664,
    7.194900035858154,    0.534500002861023,
   1.4603999853134155, 0.004600000102072954,
   1.5457500219345093,  0.11919999867677689,
   1.0192500352859497,   1.9394999742507935,
  0.10999999940395355,   0.2960500121116638,
   2.2697999477386475,  0.23149999976158142,
    2.989799976348877,   0.5165500044822693,
   0.6621000170707703
]
Optimized parameters: [
    7.753578186035156,   7.831058502197266,
    7.948733806610107,  20.090112686157227,
    7.115264415740967,  0.6144314408302307,
    1.538704752922058, 0.08447869122028351,
    1.625684380531311, 0.03922246769070625,
    1.099182367324829,  1.9394999742507935,
  0.10999999940395355,  0.2960500121116638,
   2.2697999477386475, 0.23149999976158142,
   3.0695059299468994,  0.5165500044822693,
   0.6621000170707703
]
ishiko732 commented 1 month ago

for browser, wasm may be a choice

WASM currently has issues; to obtain the current progress or use multithreading, it is necessary to set Cross-Origin-Embedder-Policy: require-corp; Cross-Origin-Opener-Policy: same-origin.

I am working on nodejs binding for it, so you may use that :P

OK, I had considered using napi-rs for bindings before. I will try using fsrs-rs-nodejs and test it out.

asukaminato0721 commented 4 weeks ago

seems partly fixed by https://github.com/open-spaced-repetition/fsrs-rs-nodejs/issues/5#issuecomment-2441729740