Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve app performance and update search bar style #7151

Open
wants to merge 7 commits into
base: canary
Choose a base branch
from

Conversation

haneenmahd
Copy link

This PR improves performance and also adds style update to the search bar. It adds a shadow to create an overlay effect.

I have updated the `positionIsValid()` function to filter out displays the only have intersection with the target point. This improves performance.
…mamnd

The `generatePrefixedCommand` is a simple pure function. But it used `map()` for looping over the shortcuts. The `map()` creates a new every time and creates unnecessary memory allocations. I have switched to using the `for..loop`.

Another change I made is in the default function for getting keymaps. I have switched from using the method `Object.keys()` which creates a new array and instead used `for..in` loop. I also declared the `keymap` variable outside of the scope to limit the number of times object is modified. Used `for..of` instead of `forEach` because it creates a new function for every iteration.
The utility electron background color converts colors for electron support. I have added a new object which is optimised for frequent reads and updates. This saves processing time and power.
For filtering out undefined properties from the `extraOptions`, `createSession` function used `Object.keys` and looped over to check for undefined keys. Using `object.fromEntries` checks for undefined properties and is also better performant.
@haneenmahd haneenmahd changed the title Improve perf Improve app performance and update search bar style Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant