An occasional kernel panic is to be expected. If you begin to see this message more and more often, consider basic troubleshooting as per Apple's instructions:
To help diagnose recurring kernel panics, record the date and time it occurs, and any information that appears with the kernel panic message.
Was the computer starting up, shutting down, or performing a particular task when the recurring kernel panic happened?
Is the kernel panic intermittent, or does it happen every time you do a certain thing?
Does it occur only when a certain external device is connected, or a device is connected to a certain port?
Isolate hardware or software as the cause of the kernel panic
Start the Mac from Recovery or its install media. Note: If a kernel panic still occurs, go to the "Hardware troubleshooting" section of this article.
Open Disk Utility and use "Repair Disk" on Mac's internal hard drive (named Macintosh HD by default).
Important: If Disk Utility is unable to repair the internal drive, you should bring the Mac to a Genius at an Apple Store, or an Apple Authorized Service Provider for service and support. Be sure to ask that, if the drive needs reformatting or replacing, they contact you about escalating your case to a special data recovery service. If you plan to visit an Apple Retail store, make a reservation at the Genius Bar using http://www.apple.com/retail/geniusbar/ (available in some countries only).
Connect an external drive with at least 10 GB of free space. Note: Make sure the external drive does not cause kernel panics and is the only device on its USB, FireWire, or Thunderbolt port. Connecting the external drive and its cables to another Mac can help make sure the drive does not cause kernel panics.
Install OS X on the external drive.
Start up from the external drive.
Install all software updates until Software Update reports your software is up to date.
Use the Apple applications on the external drive to surf the web, view QuickTime movies, email, print, scan, and/or other activities. Continue using the Mac for the amount of time it would usually take for the kernel panic to occur.
If a panic occurs, go to the "Hardware troubleshooting" section of this article to further diagnose the issue.
If a panic does not occur, go to the "Software troubleshooting" section of this article to further diagnose the issue.
I strongly advise to never update when a new OS comes out. They always take at least one year to fix all the bugs. Here is a check list from Apple Support:
Check for display issues
If your Mac doesn't appear to turn on, it's possible that the computer is turning on but the display isn't working. To see if it's a display issue, press your computer's power button. Then check for these signs that your Mac is turning on, even if the display remains dark:
You might hear a startup chime.
You might hear fan or drive noise.
If your Mac has an LED sleep indicator, it might turn on.
If your Mac notebook has a backlit keyboard, it might turn on.
When you press the Caps Lock key, the key's light turns on.
If any of these things happens and your Mac is connected to an external display, get help with video issues on external displays connected to your Mac. Otherwise, continue to the next section.
Check for power issues
If your Mac won't turn on and you've ruled out display issues, try these steps:
Make sure that the power cord and adapter are securely connected to your Mac and plugged in to a working electrical outlet. Plug in a lamp or other device to make sure the outlet works.
Try another power cord or adapter if the outlet works but your Mac still has no power.
If you're using a Mac notebook, make sure that you're using the right power adapter and cable and learn about troubleshooting MagSafe adapters. Leave the power adapter connected long enough to provide an adequate charge to the battery.
Check for other issues
Try these steps if you've ruled out power and display issues:
Disconnect all accessories that are plugged in to your Mac. This includes things like printers, USB hubs, and mobile devices.
Hold down the power button for ten seconds. Then press the power button again to see if the Mac turns on.
Reset the System Management Controller (SMC).
If you recently installed memory or a drive in your Mac, make sure that it's compatible and installed correctly. If possible, reinstall the original memory or drive to see if the issue persists.
If your Mac still won't start up after you've tried these steps, contact Apple Support. You can also visit an Apple Store or Apple Authorized Service Provider for help.
Source: https://support.apple.com/en-us/HT204267
Best Answer
As on now, macOS Mojave 10.14.4 is the latest stable release. Consider updating your iMac and see if that fixes the performance issues.
What you are observing may be due to performance optimization related issues.