Add mod: raise svchost split threshold

This commit is contained in:
Fierelier 2024-01-18 05:36:52 +01:00
parent 36389068fa
commit b751765b0f
6 changed files with 169 additions and 162 deletions

324
docgen/generate-docs.py Normal file → Executable file
View File

@ -1,162 +1,162 @@
#!/usr/bin/env python3
import sys
oldexcepthook = sys.excepthook
def newexcepthook(type,value,traceback):
oldexcepthook(type,value,traceback)
input("Press ENTER to quit.")
sys.excepthook = newexcepthook
import os
p = os.path.join
pUp = os.path.dirname
s = False
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
s = os.path.realpath(sys.executable)
else:
s = os.path.realpath(__file__)
sp = pUp(s)
# script start
import html
import shutil
def getDescription(dir):
desc = "No description"
try:
with open(p(dir,"description.txt")) as dfile:
desc = dfile.read().strip(" \t\r\n")
except:
pass
return desc
def getTags(dir):
tags = ["none"]
try:
with open(p(dir,"tags.txt")) as tfile:
tags = tfile.read().strip(" \t\r\n").split(" ")
except:
pass
return tags
def getModList(dir, modlist = {}, rootdir = False):
if rootdir == False: rootdir = dir
for root,dirs,files in os.walk(dir):
for file in sorted(dirs):
ffile = p(root,file)
lfile = ffile.replace(rootdir + os.path.sep,"",1)
modname = ffile.replace(dir + os.path.sep,"",1)
activated = True
if modname[0] == "-":
modname = modname[1:]
activated = False
if modname[0] == "[" and modname[-1] == "]":
getModList(ffile,modlist,rootdir)
continue
fmodname = p(pUp(lfile),modname)
modlist[ffile] = {
"modname": modname,
"fmodname": fmodname,
"activated": activated
}
break
return modlist
def makeHeading(title,id,size = 1):
return '<h' +str(size)+ ' id="' +id+ '"><a href="#' +id+ '">#</a> ' +html.escape(title)+ '</h' +str(size)+ '>\n'
def readTags():
tags = {}
with open(p(sp,"tags.txt"),encoding="utf-8") as tfile:
for line in tfile:
line = line.strip(" \t\r\n")
if line == "": continue
tagSplit = line.split(" ",1)
tags[tagSplit[0]] = tagSplit[1]
return tags
def main():
opusPath = pUp(sp)
ofileHtml = p(opusPath,"docs","index.html")
ofileMd = p(opusPath,"docs","index.md")
ofile = open(ofileHtml,"w",encoding="utf-8")
ofile.write('''\
<!DOCTYPE HTML>
<html>
<head>
<title>opus-nt - Mod Documentation</title>
<meta charset="UTF-8">
<style>
body {
background-color: ButtonFace;
color: ButtonText;
font: menu;
}
table {
border: 1px outset ButtonShadow;
background-color: Window;
}
th, td {
border: 1px inset ButtonShadow;
}
th, td {
padding-left: 5px;
padding-right: 5px;
}
a {
text-decoration: none;
}
h1, h2, h3, h4, h5 {
color: CaptionText;
}
</style>
</head>
<body>\
''')
tags = readTags()
ofile.write(makeHeading("Tags","tags"))
ofile.write('''\
<table>
<tr><th>Tag</th><th>Description</th></tr>
''')
for tag in tags:
ofile.write(' <tr><td><b>' +html.escape(tag)+ '</b></td><td>' +html.escape(tags[tag])+ '</td></tr>\n')
ofile.write('</table>')
modPaths = []
for root,dirs,files in os.walk(opusPath):
for file in sorted(dirs):
ffile = p(root,file)
lfile = ffile.replace(opusPath + os.path.sep,"",1)
if lfile.startswith("mods"):
modPaths.append(ffile)
break
for modPath in modPaths:
modList = getModList(modPath,{})
lmodPath = modPath.replace(opusPath + os.path.sep,"",1)
ofile.write(makeHeading("Mods: " +lmodPath,lmodPath))
ofile.write(html.escape(getDescription(modPath))+ "<br>\n")
ofile.write("<table>\n")
ofile.write(' <tr><th>Mod</th><th>Tags</th><th>Description</th></tr>\n')
for modk in modList:
mod = modList[modk]
ofile.write(' <tr><td>' +html.escape(pUp(mod["fmodname"]).replace("/","\\"))+ '\\<b>' +html.escape(mod["modname"])+ '</b></td><td>' +html.escape(", ".join(getTags(modk)))+ '</td><td>' +html.escape(getDescription(modk))+ '</td></tr>\n')
ofile.write("</table><br>\n")
ofile.write('</body>\n</html>')
ofile.close()
shutil.copyfile(ofileHtml,ofileMd)
main()
#!/usr/bin/env python3
import sys
oldexcepthook = sys.excepthook
def newexcepthook(type,value,traceback):
oldexcepthook(type,value,traceback)
input("Press ENTER to quit.")
sys.excepthook = newexcepthook
import os
p = os.path.join
pUp = os.path.dirname
s = False
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
s = os.path.realpath(sys.executable)
else:
s = os.path.realpath(__file__)
sp = pUp(s)
# script start
import html
import shutil
def getDescription(dir):
desc = "No description"
try:
with open(p(dir,"description.txt")) as dfile:
desc = dfile.read().strip(" \t\r\n")
except:
pass
return desc
def getTags(dir):
tags = ["none"]
try:
with open(p(dir,"tags.txt")) as tfile:
tags = tfile.read().strip(" \t\r\n").split(" ")
except:
pass
return tags
def getModList(dir, modlist = {}, rootdir = False):
if rootdir == False: rootdir = dir
for root,dirs,files in os.walk(dir):
for file in sorted(dirs):
ffile = p(root,file)
lfile = ffile.replace(rootdir + os.path.sep,"",1)
modname = ffile.replace(dir + os.path.sep,"",1)
activated = True
if modname[0] == "-":
modname = modname[1:]
activated = False
if modname[0] == "[" and modname[-1] == "]":
getModList(ffile,modlist,rootdir)
continue
fmodname = p(pUp(lfile),modname)
modlist[ffile] = {
"modname": modname,
"fmodname": fmodname,
"activated": activated
}
break
return modlist
def makeHeading(title,id,size = 1):
return '<h' +str(size)+ ' id="' +id+ '"><a href="#' +id+ '">#</a> ' +html.escape(title)+ '</h' +str(size)+ '>\n'
def readTags():
tags = {}
with open(p(sp,"tags.txt"),encoding="utf-8") as tfile:
for line in tfile:
line = line.strip(" \t\r\n")
if line == "": continue
tagSplit = line.split(" ",1)
tags[tagSplit[0]] = tagSplit[1]
return tags
def main():
opusPath = pUp(sp)
ofileHtml = p(opusPath,"docs","index.html")
ofileMd = p(opusPath,"docs","index.md")
ofile = open(ofileHtml,"w",encoding="utf-8")
ofile.write('''\
<!DOCTYPE HTML>
<html>
<head>
<title>opus-nt - Mod Documentation</title>
<meta charset="UTF-8">
<style>
body {
background-color: ButtonFace;
color: ButtonText;
font: menu;
}
table {
border: 1px outset ButtonShadow;
background-color: Window;
}
th, td {
border: 1px inset ButtonShadow;
}
th, td {
padding-left: 5px;
padding-right: 5px;
}
a {
text-decoration: none;
}
h1, h2, h3, h4, h5 {
color: CaptionText;
}
</style>
</head>
<body>\
''')
tags = readTags()
ofile.write(makeHeading("Tags","tags"))
ofile.write('''\
<table>
<tr><th>Tag</th><th>Description</th></tr>
''')
for tag in tags:
ofile.write(' <tr><td><b>' +html.escape(tag)+ '</b></td><td>' +html.escape(tags[tag])+ '</td></tr>\n')
ofile.write('</table>')
modPaths = []
for root,dirs,files in os.walk(opusPath):
for file in sorted(dirs):
ffile = p(root,file)
lfile = ffile.replace(opusPath + os.path.sep,"",1)
if lfile.startswith("mods"):
modPaths.append(ffile)
break
for modPath in modPaths:
modList = getModList(modPath,{})
lmodPath = modPath.replace(opusPath + os.path.sep,"",1)
ofile.write(makeHeading("Mods: " +lmodPath,lmodPath))
ofile.write(html.escape(getDescription(modPath))+ "<br>\n")
ofile.write("<table>\n")
ofile.write(' <tr><th>Mod</th><th>Tags</th><th>Description</th></tr>\n')
for modk in modList:
mod = modList[modk]
ofile.write(' <tr><td>' +html.escape(pUp(mod["fmodname"]).replace("/","\\"))+ '\\<b>' +html.escape(mod["modname"])+ '</b></td><td>' +html.escape(", ".join(getTags(modk)))+ '</td><td>' +html.escape(getDescription(modk))+ '</td></tr>\n')
ofile.write("</table><br>\n")
ofile.write('</body>\n</html>')
ofile.close()
shutil.copyfile(ofileHtml,ofileMd)
main()

View File

@ -151,6 +151,7 @@ Mods that require System rights<br>
<tr><td>[hell]\<b>no start tiles</b></td><td>quality</td><td>Get rid of the default tiles pinned to the start menu.</td></tr>
<tr><td>[hell]\<b>opus-nt_update</b></td><td>performance, quality</td><td>Remove Windows&#x27; automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version.</td></tr>
<tr><td>[hell]\<b>quick access - don&#x27;t show frequent folders</b></td><td>quality</td><td>Don&#x27;t show random folders in Explorer&#x27;s sidebar to reduce clutter.</td></tr>
<tr><td>[hell]\<b>raise svchost split threshold</b></td><td>performance</td><td>Keeps svchost processes combined to reduce memory usage.</td></tr>
<tr><td>[hell]\<b>remove user libraries</b></td><td>quality</td><td>Stops Explorer from showing user libraries everywhere, reducing clutter.</td></tr>
<tr><td>[hell]\<b>replace quick access shortcuts with user shortcut</b></td><td>quality</td><td>Removes default quick access pins and adds one for the current user to reduce clutter.</td></tr>
<tr><td>[unattend]\[10.0]\[amd64]\<b>unattend</b></td><td>quality</td><td>Skip certain questions in the last step of Windows setup.</td></tr>

View File

@ -151,6 +151,7 @@ Mods that require System rights<br>
<tr><td>[hell]\<b>no start tiles</b></td><td>quality</td><td>Get rid of the default tiles pinned to the start menu.</td></tr>
<tr><td>[hell]\<b>opus-nt_update</b></td><td>performance, quality</td><td>Remove Windows&#x27; automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version.</td></tr>
<tr><td>[hell]\<b>quick access - don&#x27;t show frequent folders</b></td><td>quality</td><td>Don&#x27;t show random folders in Explorer&#x27;s sidebar to reduce clutter.</td></tr>
<tr><td>[hell]\<b>raise svchost split threshold</b></td><td>performance</td><td>Keeps svchost processes combined to reduce memory usage.</td></tr>
<tr><td>[hell]\<b>remove user libraries</b></td><td>quality</td><td>Stops Explorer from showing user libraries everywhere, reducing clutter.</td></tr>
<tr><td>[hell]\<b>replace quick access shortcuts with user shortcut</b></td><td>quality</td><td>Removes default quick access pins and adds one for the current user to reduce clutter.</td></tr>
<tr><td>[unattend]\[10.0]\[amd64]\<b>unattend</b></td><td>quality</td><td>Skip certain questions in the last step of Windows setup.</td></tr>

View File

@ -0,0 +1 @@
Keeps svchost processes combined to reduce memory usage.

View File

@ -0,0 +1,3 @@
for key in opusnt.regQueryKeys(opusnt.regTmpPath + "system"):
if key.lower().startswith(opusnt.regTmpPath.lower() + "system\\controlset"):
opusnt.runReg(["add",key+ "\\Control","/v","SvcHostSplitThresholdInKB","/t","REG_DWORD","/d","0xffffffff","/f"])

View File

@ -0,0 +1 @@
performance