@@ -7812,6 +7812,7 @@ def check_expected_size_in_file(self, desc, filename, size):
7812
7812
print(' seen %s size: %d (expected: %d) (delta: %d), ratio to expected: %f' % (desc, size, expected_size, delta, ratio))
7813
7813
self.assertLess(ratio, size_slack)
7814
7814
7815
+ @crossplatform
7815
7816
def test_unoptimized_code_size(self):
7816
7817
# We don't care too about unoptimized code size but we would like to keep it
7817
7818
# under control to a certain extent. This test allows us to track major
@@ -10014,6 +10015,7 @@ def test(args, closure, opt):
10014
10015
'math': ('math', False),
10015
10016
'hello_wasm_worker': ('hello_wasm_worker', False, True),
10016
10017
})
10018
+ @crossplatform
10017
10019
def test_minimal_runtime_code_size(self, test_name, js, compare_js_output=False):
10018
10020
smallest_code_size_args = ['-sMINIMAL_RUNTIME=2',
10019
10021
'-sENVIRONMENT=web',
@@ -10144,28 +10146,6 @@ def get_file_gzipped_size(f):
10144
10146
print('size of ' + f + ' == ' + str(size) + ', expected ' + str(expected_size) + ', delta=' + str(size - expected_size) + print_percent(size, expected_size))
10145
10147
print('size of ' + f_gz + ' == ' + str(size_gz) + ', expected ' + str(expected_size_gz) + ', delta=' + str(size_gz - expected_size_gz) + print_percent(size_gz, expected_size_gz))
10146
10148
10147
- # Hack: Generated .mem initializer files have different sizes on different
10148
- # platforms (Windows gives x, CircleCI Linux gives x-17 bytes, my home
10149
- # Linux gives x+2 bytes..). Likewise asm.js files seem to be affected by
10150
- # the LLVM IR text names, which lead to asm.js names, which leads to
10151
- # difference code size, which leads to different relooper choices,
10152
- # as a result leading to slightly different total code sizes.
10153
- # Also as of July 16, 2020, wasm2js files have different sizes on
10154
- # different platforms (Windows and MacOS improved to give a slightly
10155
- # better thing than Linux does, which didn't change; this just
10156
- # started to happen on CI, not in response to a code update, so it
10157
- # may have been present all along but just noticed now; it only
10158
- # happens in wasm2js, so it may be platform-nondeterminism in closure
10159
- # compiler).
10160
- # TODO: identify what is causing this. meanwhile allow some amount of slop
10161
- if not common.EMTEST_REBASELINE:
10162
- if js:
10163
- slop = 30
10164
- else:
10165
- slop = 20
10166
- if size <= expected_size + slop and size >= expected_size - slop:
10167
- size = expected_size
10168
-
10169
10149
# N.B. even though the test code above prints out gzip compressed sizes, regression testing is done against uncompressed sizes
10170
10150
# this is because optimizing for compressed sizes can be unpredictable and sometimes counterproductive
10171
10151
total_output_size += size
0 commit comments