From d7ab93a1e4cad0cc3c35c5e4f15176ef9aab09ce Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 13 Feb 2024 10:48:09 -0600 Subject: [PATCH] update readme --- README.md | 12 ++++++++++++ sandbox/README.md | 14 -------------- sandbox/src/train.ts | 3 +++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6e81efa..184af93 100644 --- a/README.md +++ b/README.md @@ -1 +1,13 @@ # fsrs-browser + +This project runs [fsrs-rs](https://github.com/open-spaced-repetition/fsrs-rs) in the browser with support for training FSRS parameters. + +It git submodules [fsrs-rs](https://github.com/AlexErrant/fsrs-rs/tree/fsrs-browser) and [burn](https://github.com/AlexErrant/burn/tree/fsrs-browser) for reasons given [here](https://github.com/Tracel-AI/burn/pull/938#issuecomment-1925913866). As such, it will not be up to date with the latest fsrs-rs. + +## Building and demoing + +Run `./dev.sh` for fast builds or `./prod.sh` for fast runs. + +Run the `/sandbox` project to demo various behavior. + +I highly encourage `./prod.sh` if you intend to run training. On my machine training 24,394 FSRS items/revlogs on `./dev` takes days, while `./prod.sh` takes 3.5 seconds. diff --git a/sandbox/README.md b/sandbox/README.md index 6a17645..e9b699e 100644 --- a/sandbox/README.md +++ b/sandbox/README.md @@ -1,15 +1,5 @@ ## Usage -Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`. - -This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template. - -```bash -$ npm install # or pnpm install or yarn install -``` - -### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs) - ## Available Scripts In the project directory, you can run: @@ -28,7 +18,3 @@ It correctly bundles Solid in production mode and optimizes the build for the be The build is minified and the filenames include the hashes.
Your app is ready to be deployed! - -## Deployment - -You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.) diff --git a/sandbox/src/train.ts b/sandbox/src/train.ts index 82e4490..d09a5eb 100644 --- a/sandbox/src/train.ts +++ b/sandbox/src/train.ts @@ -23,6 +23,7 @@ async function loadSqliteAndRun(ab: ArrayBuffer) { await wasm() await initThreadPool(navigator.hardwareConcurrency) await sleep(1000) // the workers need time to spin up. TODO, post an init message and await a response. Also maybe move worker construction to Javascript. + console.time('full training time') let fsrs = new Fsrs() const db = await getDb(ab) let baseQuery = `FROM revlog @@ -77,7 +78,9 @@ async function loadSqliteAndRun(ab: ArrayBuffer) { types, usns, ) + console.timeEnd('full training time') console.log('trained weights are', weights) + console.log('revlog count', count) } finally { db.close() }