ChromeGaming / Formation-Absent

Formation Absent is a turn-based puzzle - an abstract representation of a battle. In each of the 13 stages two armies are colliding. As a member of the Green side, youโ€™ll have to restore the lost battle formation of the Green party. Move through the battlefield..
https://chromegaming.github.io/Formation-Absent/
MIT License
8 stars 30 forks source link

[Bug]: Memory Leak and Performance Issues #68

Open Swapnilden opened 6 days ago

Swapnilden commented 6 days ago

Give a brief about the bug โœ๏ธ

The code in mouseEffect.js creates a new ripple element on every mouse movement, leading to potential memory leaks and performance degradation.

What is the expected behavior? ๐Ÿค”

The ripple effect should only be triggered under specific conditions, such as throttled mouse movements or click events, to avoid performance issues and memory leaks.

Provide step by step information reproduce the bug ๐Ÿ“„

  1. Observe Performance: Move the mouse rapidly across the screen and observe the performance. Note any lag or increased memory usage.
  2. Check Element Creation: Monitor the number of DOM elements created during mouse movement. Use browser developer tools to inspect the DOM.
  3. Implement Throttling: Introduce a throttle function to limit the number of ripples created.
  4. Validate Improvement: Test the application again to ensure improved performance and reduced memory usage.

Select program in which you are contributing

GSSoC24

Code of Conduct

github-actions[bot] commented 6 days ago

Hey @Swapnilden! ๐Ÿ‘‹

๐Ÿ‘‰ Thanks for opening this issue. We appreciate your contribution and will look into it as soon as possible. ๐Ÿ‘‰ Donโ€™t forget to star our Formation-Absent and Follow Us on GitHub ๐Ÿ‘‰ Make sure you join our Discord, we have created separate channels for all projects