mediar-ai / screenpipe

rewind.ai x cursor.com = your AI assistant that has all the context. 24/7 screen & voice recording for the age of super intelligence. get your data ready or be left behind
https://screenpi.pe
MIT License
9.65k stars 568 forks source link

optimize window validation logic #576

Closed TanGentleman closed 4 weeks ago

TanGentleman commented 4 weeks ago

name: pull request about: submit changes to the project title: "optimize window validation logic" labels: 'enhancement' assignees: 'TanGentleman'


description

Improve performance of is_valid_window() with several optimizations:

No changes in behavior, purely performance improvements by reducing redundant operations and string allocations.

related issue: #

type of change

checklist

additional notes

any other relevant information about the pr.

vercel[bot] commented 4 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
screenpipe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 1:14am
TanGentleman commented 4 weeks ago

Ideally, I'd really appreciate exact string matching for App Name / Window name for ignored windows. I'm not sure the best way to pass this from the CLI to this function efficiently, but screenpipe seems to be recording 10s of thousands of windows that I have no trivial way of excluding!

Having too lax of a substring excludes things like a browser windows with that substring. I certainly want to save those, but it seems like if ignored, it overrides validity in include_list.

Perhaps an early return of True if the window is in include_list?

louis030195 commented 4 weeks ago

Ideally, I'd really appreciate exact string matching for App Name / Window name for ignored windows. I'm not sure the best way to pass this from the CLI to this function efficiently, but screenpipe seems to be recording 10s of thousands of windows that I have no trivial way of excluding!

Having too lax of a substring excludes things like a browser windows with that substring. I certainly want to save those, but it seems like if ignored, it overrides validity in include_list.

Perhaps an early return of True if the window is in include_list?

hmm

i think some people (including me) like also the possibility to use a string contain for window include / exclude

but probably could make everything possible, in latest app release we added bunch of default in app settings to ignore useless windows but not yet added as default in cli