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

Commits on Apr 30, 2023

  1. perf: filter displays based on the intersection with the target position

    I have updated the `positionIsValid()` function to filter out displays the only have intersection with the target point. This improves performance.
    haneenmahd committed Apr 30, 2023
    Configuration menu
    Copy the full SHA
    b353a28 View commit details
    Browse the repository at this point in the history
  2. perf: improve performance for mapping keys and generating prefixed co…

    …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.
    haneenmahd committed Apr 30, 2023
    Configuration menu
    Copy the full SHA
    8da041e View commit details
    Browse the repository at this point in the history
  3. perf: cache background colors converted to support electron

    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.
    haneenmahd committed Apr 30, 2023
    Configuration menu
    Copy the full SHA
    39c0a56 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b8764c7 View commit details
    Browse the repository at this point in the history
  5. perf: use Object.fromEntries for better performance

    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 committed Apr 30, 2023
    Configuration menu
    Copy the full SHA
    38c186d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3c7d362 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2567bfd View commit details
    Browse the repository at this point in the history