Skip to content

Commit df50139

Browse files
committed
remove test cache size overrides
1 parent f8ea068 commit df50139

File tree

5 files changed

+1
-26
lines changed

5 files changed

+1
-26
lines changed

azure-pipelines-PR.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,11 @@ stages:
457457
_configuration: Release
458458
_testKind: testFSharpQA
459459
transparentCompiler:
460-
FSHARP_CACHE_OVERRIDE: 256
461460
vs_release:
462461
_configuration: Release
463462
_testKind: testVs
464463
setupVsHive: true
465464
transparentCompiler:
466-
FSHARP_CACHE_OVERRIDE: 256
467465
transparent_compiler_release:
468466
_configuration: Release
469467
_testKind: testCoreclr

src/Compiler/Checking/TypeRelations.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let getTypeSubsumptionCache =
3636
let options =
3737
match g.compilationMode with
3838
| CompilationMode.OneOff -> Caches.CacheOptions.getDefault() |> Caches.CacheOptions.withNoEviction
39-
| _ -> { Caches.CacheOptions.getDefault() with TotalCapacity = 131072; HeadroomPercentage = 75 }
39+
| _ -> { Caches.CacheOptions.getDefault() with TotalCapacity = 65536; HeadroomPercentage = 75 }
4040
new Caches.Cache<TTypeCacheKey, bool>(options, "typeSubsumptionCache")
4141
Extras.WeakMap.getOrCreate factory
4242

src/Compiler/Utilities/Caches.fs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,6 @@ module CacheOptions =
118118
CacheOptions.EvictionMode = EvictionMode.NoEviction
119119
}
120120

121-
module Cache =
122-
// During testing a lot of compilations are started in app domains and subprocesses.
123-
// This is a reliable way to pass the override to all of them.
124-
[<Literal>]
125-
let private overrideVariable = "FSHARP_CACHE_OVERRIDE"
126-
127-
/// Use for testing purposes to reduce memory consumption in testhost and its subprocesses.
128-
let OverrideCapacityForTesting () =
129-
Environment.SetEnvironmentVariable(overrideVariable, "4096", EnvironmentVariableTarget.Process)
130-
131-
let applyOverride (options: CacheOptions<_>) =
132-
match Int32.TryParse(Environment.GetEnvironmentVariable(overrideVariable)) with
133-
| true, n when options.TotalCapacity > n -> { options with TotalCapacity = n }
134-
| _ -> options
135-
136121
// It is important that this is not a struct, because LinkedListNode holds a reference to it,
137122
// and it holds the reference to that Node, in a circular way.
138123
[<Sealed; NoComparison; NoEquality>]
@@ -176,8 +161,6 @@ type Cache<'Key, 'Value when 'Key: not null> internal (options: CacheOptions<'Ke
176161
if options.HeadroomPercentage < 0 then
177162
invalidArg "HeadroomPercentage" "HeadroomPercentage must be positive"
178163

179-
let options = Cache.applyOverride options
180-
181164
let name = defaultArg name (Guid.NewGuid().ToString())
182165

183166
// Determine evictable headroom as the percentage of total capcity, since we want to not resize the dictionary.

src/Compiler/Utilities/Caches.fsi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ module internal CacheOptions =
4949
/// Set eviction mode to NoEviction.
5050
val withNoEviction: CacheOptions<'Key> -> CacheOptions<'Key>
5151

52-
module internal Cache =
53-
/// Use for testing purposes to reduce memory consumption in testhost and its subprocesses.
54-
val OverrideCapacityForTesting: unit -> unit
55-
5652
[<Sealed; NoComparison; NoEquality>]
5753
type internal Cache<'Key, 'Value when 'Key: not null> =
5854
new: options: CacheOptions<'Key> * ?name: string -> Cache<'Key, 'Value>

tests/FSharp.Test.Utilities/XunitHelpers.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ module OneTimeSetup =
202202
log "Adding AssemblyResolver"
203203
AssemblyResolver.addResolver ()
204204
#endif
205-
log "Overriding cache capacity"
206-
Cache.OverrideCapacityForTesting()
207205
log "Installing TestConsole redirection"
208206
TestConsole.install()
209207

0 commit comments

Comments
 (0)