How to install:

What it does:

Problems?

BETA

What is this low FPS bug:

So how is this fixed?

for(int i = 0; i < modCount; i++)

{

auto form = GetFormById((i << 24) | (formId & 0x00FFFFFF)); // GetFormId contains mutex locking

// ... some other checks here

}

Other stuff

Changelog

1. Install DLL Plugin Loader , make sure to read install instructions of that mod, it must be installed manually.THEN2. Use mod manager to install this mod.OR2. Put the folder "DLLPlugins" from downloaded archive into your Data directory.Fixes a problem in game code that causes low FPS with many ESP or ESM plugins installed. Also adds option to enable OSAllocators like in vanilla Skyrim, but it's disabled by default because for me it lowered FPS slightly.If you encounter problems such as increased crashing or some new bugs that didn't exist before, please let me know here. I can only test so much alone and I don't even play SSE anyway. You can consider this modfor now and let others test first if you value your save game.There is a bug in game code where if you have more than a few dozen ESP or ESM plugins installed the game FPS will become much lower in some areas. The ESP or ESM file content does not matter at all they can be empty dummy plugins with no masters. This happens because there are at least 4 nested iteration loops the game does in every frame and the lowest loop iterates for each plugin installed, normally this wouldn't be an issue but this code runs on multiple threads and for each plugin it locks a mutex every time, this is very slow. It's not even really a bug, just bad implementation.But you can test the bug yourself, here's how1. Make sure your FPS is uncapped completely, this means bLockFrameRate=0 in Skyrim.ini under [Display] and iVSyncPresentInterval=0 in SkyrimPrefs.ini under [Display] as well. Obviously I'm not saying to play like this, it is just used to show for the test just how much FPS you lose for nothing.2. Get some way to display your FPS in game, could be Fraps, your graphics card software, ENB or something else.3. Disable all mods except the base game DLC.4. In main menu put "coc RiftenOrigin", run to the middle of marketplace and look into some specific location you can remember. Check your FPS now. For me it was 145.5. Download empty ESP plugin , copy and rename it so you have 240 of these, or use some script to do it. Enable these plugins in-game or mod manager or however you do it.6. Type again from main menu "coc RiftenOrigin" and go to the same place, look at the same point. Check your FPS again. This is with completely empty ESP setup with no extra anything to load.For me it was 145 FPS without mods and 50 FPS with those empty plugins, that's huge loss for absolutely no reason. Although Riften is the most significant loss of FPS for this test.Other places I tested:"coc Riverwood", FPS 115 -> 80"coc FalkreathExterior01", FPS 102 -> 53I rewrote the loop that does this basically:and changed it to use a custom search method that only loops through forms that actually exist there. Also instead of locking for each form, it locks once for the whole search.Thanks to people in reddit for pointing out the bug to me.Thanks to everyone who helps test and reports issues.No, I won't make this for consoles.This same bug does Not happen in vanilla Skyrim.If you find this mod anywhere else it's stolen.v2 (27/06/2017) - Changed the method of how the bug is fixed which should reduce stutters a lot.