Giter Site home page Giter Site logo

extend path cache duration? about z HOT 2 CLOSED

rupa avatar rupa commented on August 17, 2024 1
extend path cache duration?

from z.

Comments (2)

rupa avatar rupa commented on August 17, 2024

I've actually been thinking about this recently ... my new job has a bit of a different workflow that my last, and I've been noticing dirs age out of the datafile earlier than I expect. Pretty much all of the numbers about this were picked arbitrarily, and there's several possibilities for tweaking/improving behavior. I would welcome suggestions from anyone that wishes to experiment, and believes they've found more intuitive 'settings'.

To that end, here's the stuff you can play around with:

  • See the lines:

    if( count > 1000 ) {
     for( i in rank ) print i "|" 0.9*rank[i] "|" time[i] # aging
    

    count is the sum of all the ranks (how many times you hit enter in a dir) in the datafile. Entries don't start getting aged out until the total rank count exceeds 1000. So, we can raise that number to delay aging.
    Whenever the count hits that threshold, every entry in the file is 'aged' by multiplying the rank by '0.9'. So, we can make that number closer to 1 to slow down aging.

  • A few lines up:

   $2 >= 1 {

When the rank on a directory goes below 1, it is dropped from the datafile. So we can lower that number to keep aged directories from being removed for a while longer.

Some combination of tweaks to these should yield better results for you.

Furthermore, it occurs to me that I don't mess with 'frecency' here, I only use it when weighting directories that are still in the datafile. It's possible that it would be a good idea to use that in aging calculation - but I can't really think of a way to use it that isn't arguably counterproductive.

I don't want to make these things configurable, I prefer z to be something that just works as intuitively as possible without fiddling, but these aren't very carefully chosen constants and I'm sure they could be better.

from z.

twe4ked avatar twe4ked commented on August 17, 2024

I often run into this issue, I would love to see the time they stay around raised. Is there a good reason to kill any directory you have visited more then say 5 times?

I don't want to make these things configurable, I prefer z to be something that just works as intuitively as possible without fiddling, but these aren't very carefully chosen constants and I'm sure they could be better.

I pull z in using another tool so I can't easily modify the numbers without having them configurable somehow. Perhaps having an option to switch off removing directories from the index would work.

EDIT: That being said I also like things that just work. Maybe the numbers just need to be tweaked.

from z.

Related Issues (20)

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.