Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
34438fac86 Make two torture tests slightly easier ...
... to make them pass on testing.mercurylang.org.
2022-01-15 00:14:19 +11:00
Zoltan Somogyi
fdd141bf77 Clean up the tests in the other test directories.
tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the tests
    that check compiler error messages, expect the new line numbers.

browser/cterm.m:
browser/tree234_cc.m:
    Import only one module per line.

tests/hard_coded/boyer.m:
    Fix something I missed.
2015-02-16 12:32:18 +11:00
Fergus Henderson
0f911044c8 Fix a performance problem reported by Tom Conway,
Estimated hours taken: 10

Fix a performance problem reported by Tom Conway,
that caused the compiler to take forever when compiling
very simple test cases making use of user-defined insts.

compiler/inst_match.m:
compiler/inst_util.m:
	In the implementation of the procedures that traverse insts, e.g.
	inst_matches_initial, inst_matches_final, inst_is_ground, etc., ensure
	that we thread the set of already processed inst names through the
	code, i.e. pass it both in and out, rather than just passing it in.
	This ensures that we don't traverse the same inst name more than once
	for each call to one of those top-level procedures.
	The previous algorithm lead to an exponential performance
	blow-out.

	Also change mode_list_contains_inst_var so that it does not
	expand modes or defined_insts, but instead just returns the
	inst_vars that the mode list contains directly.

tests/valid/Mmakefile:
tests/valid/inst_perf_bug_1.m:
tests/valid/inst_perf_bug_2.m:
	Add a couple of regression tests, one for the performance bug
	that this change fixes, one for a similar performance bug that
	still remains even after this change.  For now only the first
	one is enabled.
2000-02-22 10:56:40 +00:00