How to get all Joomla plugins loaded

Sometimes it would be good to know which Joomla plugins are loaded as they may increase your site's loading and you can turn them off. So here you are, it outputs all the plugins' groups with plugins loaded:
<?php jimport( 'joomla.plugin.plugin' ); $plulginGroupList = JFactory::getDBO()->setQuery(" SELECT DISTINCT folder FROM #__plugins ")->loadObjectList(); foreach( $plulginGroupList as $plulginGroup ){ echo "<pre>"; print_r( "Plugin group: " . strtoupper( $plulginGroup->folder ) ); echo "</pre>"; echo "<pre>"; print_r( "=====================" ); echo "</pre>"; $plugins = JPluginHelper::getPlugin($plulginGroup->folder, ''); foreach( $plugins as $plugin ){ echo "<pre>"; print_r($plugin->name); echo "</pre>"; } echo "<pre>"; print_r( "" ); echo "</pre>"; } ?>

Joomla Articles