Browse Source

Add option to enable hxb cache optimizations to run on non hxb cache

Don't do this at home.
Rudy Ges 4 months ago
parent
commit
8a9c73e4ea
2 changed files with 7 additions and 1 deletions
  1. 6 0
      src-json/define.json
  2. 1 1
      src/compiler/server.ml

+ 6 - 0
src-json/define.json

@@ -82,6 +82,12 @@
 		"signatureNeutral": true,
 		"doc": "Disable shortcuts used by hxb cache to speed up display requests."
 	},
+	{
+		"name": "ExperimentalCacheOptimizations",
+		"define": "experimental-cache-opt",
+		"signatureNeutral": true,
+		"doc": "Enable optimizations meant for hxb cache to run on non-hxb cache. Does nothing without -D disable-hxb-cache"
+	},
 	{
 		"name": "EnableParallelism",
 		"define": "enable-parallelism",

+ 1 - 1
src/compiler/server.ml

@@ -226,7 +226,7 @@ let get_changed_directories sctx com =
 let full_typing com m_extra =
 	com.is_macro_context
 	|| com.display.dms_full_typing
-	|| Define.defined com.defines Define.DisableHxbCache
+	|| (Define.defined com.defines Define.DisableHxbCache && not (Define.defined com.defines Define.ExperimentalCacheOptimizations))
 	|| Define.defined com.defines Define.DisableHxbOptimizations
 	|| DisplayPosition.display_position#is_in_file (Path.UniqueKey.lazy_key m_extra.m_file)