Title: Javascript Causing High CPU Usage
Last modified: May 18, 2023

---

# Javascript Causing High CPU Usage

 *  Resolved [max_Q](https://wordpress.org/support/users/max_q/)
 * (@max_q)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/javascript-causing-high-cpu-usage/)
 * Events-manager.js is causing high CPU usage under certain circumstances. As near
   as I can tell, this is what causes it. All testing was done on WP 6.2.1, EM 6.3,
   default Twenty Twenty-Three and no other plugins active:
 * I’m rendering a small calendar (.size-small) above the events list by calling
   EM_Calendar::output() with ‘calendar_size’ => ‘small’ as one of the arguments.
   When I do that, cpu usage on that browser tab in both Firefox and Chrome goes
   up to 25%-45%. Chrome also starts repeatedly displaying a notice in the console“[
   Violation] Forced reflow while executing JavaScript took ms” approximately every
   100ms.
 * Blocking the load of events-manager.js brings the cpu usage back to normal. So
   does removing the .size-small class from the calendar in developer tools. So 
   does changing Event Preview Mode from Modal Popup to Tooltip or None in Settings-
   >Formatting->Calendar->Preview Formats.
 * Adding back the .size-small class on the .em-calendar div in developer tools 
   will trigger the high cpu usage.
 * It seems like the small calendar has to be on the same page as the events list
   for this to happen. The high cpu usage doesn’t occur on a page with only the 
   small calendar.
 * Hope that’s enough information.

The topic ‘Javascript Causing High CPU Usage’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [max_Q](https://wordpress.org/support/users/max_q/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/javascript-causing-high-cpu-usage/)
 * Status: resolved