Git Product home page Git Product logo

Comments (7)

mehw avatar mehw commented on August 16, 2024 1

@gcv: Thank you. I'll take a look this week-end. I'm sorry for answering you only now... crazy weeks ;)

from perspective-el.

mehw avatar mehw commented on August 16, 2024 1

@gcv: Hi, I managed to speed up the processing further... I'm currently perfecting the code. Expect a PR soon ;)

I think there needs to be a much faster mechanism for checking which perspectives a buffer is in. Maybe each buffer should keep track of it in a buffer-local variable, which will make the lookup in persp-maybe-kill-buffer much faster.

Benchmarks reveal that the processing could be sped up going bare metal, beyond the utility functions, accessing directly the data.

I put in a hack to allow killing temporary buffers (which we should not care about) without the expensive check. See 672d02d.

It's working on temporary buffers killed directly with kill-buffer. Smart solution ;)

from perspective-el.

gcv avatar gcv commented on August 16, 2024

I think there needs to be a much faster mechanism for checking which perspectives a buffer is in. Maybe each buffer should keep track of it in a buffer-local variable, which will make the lookup in persp-maybe-kill-buffer much faster.

from perspective-el.

mehw avatar mehw commented on August 16, 2024

I think there needs to be a much faster mechanism for checking which perspectives a buffer is in. Maybe each buffer should keep track of it in a buffer-local variable, which will make the lookup in persp-maybe-kill-buffer much faster.

Thank you for the suggestions @gcv, I'm starting debugging to focus the problem... I'll report back to you ASAP ;)

from perspective-el.

mehw avatar mehw commented on August 16, 2024

Hi @gcv, after nights of debugging I can't manage to trigger the mentioned bug... maybe @deejayem, @ibytao, and @dpassen can give some context. I would like to design some regression tests...

I see there was a discussion about the recursive minibuffer in #163... I tried (setq enable-recursive-minibuffers t) and also (savehist-mode) with (setq savehist-autosave-interval 1) but nothing...

How should I setup Emacs 27.2 to reproduce the bug #167? I'm on Gentoo GNU/Linux, by the way.

What sequence of commands should I execute?

Thank you all. In the meantime, I'll keep trying ;)

from perspective-el.

gcv avatar gcv commented on August 16, 2024

Thanks for looking into it. Don’t worry about that bug specifically. Commit 6e87eeb in master worked around it.

I commented out persp-maybe-kill-buffer because of how frequently it gets called. It made basic Magit use feel very sluggish. When I put a breakpoint in it and start Magit or Helm, persp-maybe-kill-buffer gets hit a lot because those packages create and destroy tons of temporary buffers. I run with a lot of perspectives and buffers, so the traversals in that function take a while. Feels like there’s an O(n^2) thing going on.

Maybe just adding a simple heuristic would be enough. Like assuming every buffer name that starts with a space (“hidden” buffer) can automatically be killed because none of them belong to a perspective. Not sure.

I still really like the intent behind persp-maybe-kill-buffer — it’s just a fairly intrusive thing to have to run all the time, and so we need to make it really fast.

Feel free to look at my Emacs configuration (27.2, Mac) for inspiration: https://github.com/gcv/dotfiles/tree/master/emacs

from perspective-el.

gcv avatar gcv commented on August 16, 2024

@mehw: I put in a hack to allow killing temporary buffers (which we should not care about) without the expensive check. See 672d02d.

Then I reenabled the check, but hid it behind a feature flag, and turned it off by default: 248b4e9 — tests are now passing again.

I'll try running the code with persp-feature-flag-prevent-killing-last-buffer-in-perspective set to t for a while and see if I run into trouble. Please do the same. If everything looks good, I'll turn it on by default.

from perspective-el.

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.