GithubHelp home page GithubHelp logo

Comments (6)

isosphere avatar isosphere commented on June 16, 2024 1

Instead of "(pull ?p [*])" "(pull ?p [:block/journal-day])" might be sufficient.

I've benchmarked the * query with 100 samples, and for my journals it takes about 160 ms to execute the query.

I didn't have to compile 100 samples to see the difference; I'm immediately and consistently getting 80 ms with your suggested query. I'll implement it permanently, thank you!

A 50% improvement in execution speed is pretty good.

from logseq-journals-nextprev.

YU000jp avatar YU000jp commented on June 16, 2024

There's a callback for that.

logseq.App.onTodayJournalCreated(({ title }) => {

})

May need to update the version of the plugin API "@logseq/lib" from 0.0.15 to 0.0.17 for this to work normally. (package.json & yarm)

from logseq-journals-nextprev.

isosphere avatar isosphere commented on June 16, 2024

May need to update the version of the plugin API "@logseq/lib" from 0.0.15 to 0.0.17 for this to work normally. (package.json & yarm)

I've done so, but it seems like the hook doesn't fire. Maybe I'm doing something wrong, or maybe "onTodayJournalCreated" refers to a specific type of journal creation (what's "today" mean here?). The hook isn't documented, unfortunately.

There doesn't seem to be a way to hook into deletion either, so maybe we lack the hooks required to reliably keep the cache updated. I'd rather the plugin behave reliably and a bit slow, than skip to pages that don't exist anymore or miss new ones but do so faster.

I wonder if the query would be faster if we didn't (pull ?p [*]) and instead picked and chose exactly what we wanted it to give us? I can try benchmarking that at some point, but the speed isn't bugging me yet with over a thousand journals.

from logseq-journals-nextprev.

YU000jp avatar YU000jp commented on June 16, 2024

Sorry. Two hooks caught fire, but it wasn't enough. I also have two years worth of journals accumulated, but the query speed still seems to be fine.

from logseq-journals-nextprev.

YU000jp avatar YU000jp commented on June 16, 2024

Instead of "(pull ?p [*])" "(pull ?p [:block/journal-day])" might be sufficient.

from logseq-journals-nextprev.

YU000jp avatar YU000jp commented on June 16, 2024

Great!

from logseq-journals-nextprev.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.