@@ -3,6 +3,7 @@ import 'package:fluent_ui/fluent_ui.dart';
33
44import 'package:revitool/utils.dart' ;
55import 'package:revitool/widgets/card_highlight.dart' ;
6+ import 'package:revitool/widgets/subtitle.dart' ;
67import 'package:win32_registry/win32_registry.dart' ;
78import 'package:process_run/shell_run.dart' ;
89import 'package:fluentui_system_icons/fluentui_system_icons.dart' as msicons;
@@ -24,14 +25,18 @@ class _PerformancePageState extends State<PerformancePage> {
2425
2526 bool foBool = readRegistryInt (RegistryHive .currentUser, r'System\GameConfigStore' , "GameDVR_FSEBehaviorMode" ) != 2 ;
2627
28+ //NTFS
29+ bool ntfsLTABool = readRegistryInt (RegistryHive .localMachine, r'SYSTEM\ControlSet001\Control\FileSystem' , "RefsDisableLastAccessUpdate" ) != 1 ;
30+ bool ntfsEdTBool = readRegistryInt (RegistryHive .localMachine, r'SYSTEM\ControlSet001\Control\FileSystem' , "NtfsDisable8dot3NameCreation" ) != 1 ;
31+ bool ntfsMUBool = readRegistryInt (RegistryHive .localMachine, r'SYSTEM\ControlSet001\Control\FileSystem' , "NtfsMemoryUsage" ) == 2 ;
32+
2733 @override
2834 Widget build (BuildContext context) {
2935 return ScaffoldPage .scrollable (
3036 header: const PageHeader (
3137 title: Text ('Performance' ),
3238 ),
3339 children: [
34- // subtitle(content: const Text('A simple ToggleSwitch')),
3540 CardHighlight (
3641 child: Row (
3742 children: [
@@ -232,6 +237,141 @@ class _PerformancePageState extends State<PerformancePage> {
232237 ],
233238 ),
234239 ),
240+
241+ if (expBool) ...[
242+ subtitle (content: const Text ("NTFS" )),
243+ CardHighlight (
244+ child: Row (
245+ children: [
246+ const SizedBox (width: 5.0 ),
247+ const Icon (FluentIcons .time_entry, size: 24 ),
248+ const SizedBox (width: 15.0 ),
249+ Expanded (
250+ child: SizedBox (
251+ child: Column (
252+ crossAxisAlignment: CrossAxisAlignment .start,
253+ children: [
254+ InfoLabel (label: 'Last Access Time' ),
255+ Text (
256+ "Disabling Last Time Access improves the speed of file and directory access, reduces disk I/O load and latency" ,
257+ style: FluentTheme .of (context).brightness.isDark
258+ ? const TextStyle (fontSize: 11 , color: Color .fromARGB (255 , 200 , 200 , 200 ), overflow: TextOverflow .fade)
259+ : const TextStyle (fontSize: 11 , color: Color .fromARGB (255 , 117 , 117 , 117 ), overflow: TextOverflow .fade),
260+ )
261+ ],
262+ ),
263+ ),
264+ ),
265+ const SizedBox (width: 5.0 ),
266+ Text (ntfsLTABool ? "On" : "Off" ),
267+ const SizedBox (width: 10.0 ),
268+ ToggleSwitch (
269+ checked: ntfsLTABool,
270+ onChanged: (bool value) async {
271+ setState (() {
272+ ntfsLTABool = value;
273+ });
274+
275+ if (ntfsLTABool) {
276+ await run ('fsutil behavior set disableLastAccess 0' );
277+ } else {
278+ await run ('fsutil behavior set disableLastAccess 1' );
279+ }
280+ },
281+ ),
282+ ],
283+ ),
284+ ),
285+ const SizedBox (height: 5.0 ),
286+ CardHighlight (
287+ child: Row (
288+ children: [
289+ const SizedBox (width: 5.0 ),
290+ const Icon (FluentIcons .file_system, size: 24 ),
291+ const SizedBox (width: 15.0 ),
292+ Expanded (
293+ child: SizedBox (
294+ child: Column (
295+ crossAxisAlignment: CrossAxisAlignment .start,
296+ children: [
297+ InfoLabel (label: '8.3 Naming' ),
298+ Text (
299+ "Disabling 8.3 names improves speed and security" ,
300+ style: FluentTheme .of (context).brightness.isDark
301+ ? const TextStyle (fontSize: 11 , color: Color .fromARGB (255 , 200 , 200 , 200 ), overflow: TextOverflow .fade)
302+ : const TextStyle (fontSize: 11 , color: Color .fromARGB (255 , 117 , 117 , 117 ), overflow: TextOverflow .fade),
303+ )
304+ ],
305+ ),
306+ ),
307+ ),
308+ const SizedBox (width: 5.0 ),
309+ Text (ntfsEdTBool ? "On" : "Off" ),
310+ const SizedBox (width: 10.0 ),
311+ ToggleSwitch (
312+ checked: ntfsEdTBool,
313+ onChanged: (bool value) async {
314+ setState (() {
315+ ntfsEdTBool = value;
316+ });
317+
318+ if (ntfsEdTBool) {
319+ await run ('fsutil behavior set disable8dot3 0' );
320+ } else {
321+ await run ('fsutil behavior set disable8dot3 1' );
322+ }
323+ },
324+ ),
325+ ],
326+ ),
327+ ),
328+ const SizedBox (height: 5.0 ),
329+ CardHighlight (
330+ expandTitle: "More information" ,
331+ codeSnippet:
332+ "Increasing the physical memory doesn't always increase the amount of paged pool memory available to NTFS. Setting memoryusage to 2 raises the limit of paged pool memory. This might improve performance if your system is opening and closing many files in the same file set and is not already using large amounts of system memory for other apps or for cache memory. If your computer is already using large amounts of system memory for other apps or for cache memory, increasing the limit of NTFS paged and non-paged pool memory reduces the available pool memory for other processes. This might reduce overall system performance.\n\n Default is Off" ,
333+ child: Row (
334+ children: [
335+ const SizedBox (width: 5.0 ),
336+ const Icon (FluentIcons .hard_drive_unlock, size: 24 ),
337+ const SizedBox (width: 15.0 ),
338+ Expanded (
339+ child: SizedBox (
340+ child: Column (
341+ crossAxisAlignment: CrossAxisAlignment .start,
342+ children: [
343+ InfoLabel (label: 'Increase the limit of paged pool memory to NTFS' ),
344+ // Text(
345+ // "improve performance if your system is opening and closing many files in the same file set and is not already using large amounts of system memory for other apps or for cache memory",
346+ // style: FluentTheme.of(context).brightness.isDark
347+ // ? const TextStyle(fontSize: 11, color: Color.fromARGB(255, 200, 200, 200), overflow: TextOverflow.fade)
348+ // : const TextStyle(fontSize: 11, color: Color.fromARGB(255, 117, 117, 117), overflow: TextOverflow.fade),
349+ // )
350+ ],
351+ ),
352+ ),
353+ ),
354+ const SizedBox (width: 5.0 ),
355+ Text (ntfsMUBool ? "On" : "Off" ),
356+ const SizedBox (width: 10.0 ),
357+ ToggleSwitch (
358+ checked: ntfsMUBool,
359+ onChanged: (bool value) async {
360+ setState (() {
361+ ntfsMUBool = value;
362+ });
363+
364+ if (ntfsMUBool) {
365+ await run ('fsutil behavior set memoryusage 2' );
366+ } else {
367+ await run ('fsutil behavior set memoryusage 1' );
368+ }
369+ },
370+ ),
371+ ],
372+ ),
373+ ),
374+ ]
235375 ],
236376 );
237377 }
0 commit comments