Zoltan Somogyi
17b1b0725d
Optimize the tests for builtin types when printing terms.
...
library/stream.string_writer.m:
When printing terms to a stream, we special case the handling
of a whole bunch of builtin types. We used to test for these one by one,
in sequence, which can be very slow.
Switch to an approach where we first get the identity of the term's type,
and we test for a type for one of these types *if, and only if*,
the identity says that it is one of the types we want to special-case
in one of the modules that has to-be-special-cased types.
This code is significantly longer than the original, but
(a) it should be significantly faster (it speeds up a microbenchmark
by a bit more than a third), and (b) it should not slow down
if we want to special-case the treatment of more types in the future.
tests/hard_coded/stream_string_writer_types.{m,exp}:
A test to ensure that the assumptions that the new code in
stream.string_writer.m makes about which builtin type is defined where
are still valid.
tests/hard_coded/Mmakefile:
Enable the new test case.
2019-10-17 17:56:14 +11:00
..
2018-08-02 14:45:42 +10:00
2019-10-15 17:48:36 +11:00
2019-09-05 17:06:24 +10:00
2019-07-03 22:37:19 +02:00
2018-06-21 18:55:08 +02:00
2019-10-15 17:48:36 +11:00
2019-08-27 14:34:01 +10:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-05-01 21:29:05 +10:00
2019-05-01 21:29:05 +10:00
2019-08-27 14:34:01 +10:00
2018-06-21 18:55:08 +02:00
2019-07-03 22:37:19 +02:00
2019-10-16 22:55:19 +11:00
2019-06-24 16:38:42 +02:00
2019-10-15 17:48:36 +11:00
2019-08-21 12:43:14 +10:00
2018-06-21 18:55:08 +02:00
2019-10-17 16:51:33 +11:00
2019-09-14 00:03:44 +10:00
2019-09-14 00:03:44 +10:00
2019-10-14 16:45:21 +11:00
2019-06-28 20:41:14 +02:00
2019-07-03 22:37:19 +02:00
2018-06-21 18:55:08 +02:00
2019-09-28 02:57:00 +10:00
2019-06-28 20:59:28 +02:00
2019-09-14 00:03:44 +10:00
2019-08-28 00:52:17 +10:00
2018-06-21 18:55:08 +02:00
2018-08-08 21:17:12 +10:00
2018-06-26 17:24:40 +02:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2018-10-19 11:01:33 +11:00
2019-07-03 22:37:19 +02:00
2019-10-15 17:48:36 +11:00
2019-09-19 22:18:33 +10:00
2019-10-15 17:48:36 +11:00
2019-08-27 14:34:01 +10:00
2019-08-28 00:52:17 +10:00
2019-07-03 22:37:19 +02:00
2019-09-25 08:58:15 +10:00
2019-10-14 16:46:14 +11:00
2018-06-21 18:55:08 +02:00
2018-06-21 18:55:08 +02:00
2019-09-06 02:45:45 +10:00
2019-07-26 01:46:51 +02:00
2019-08-28 00:52:17 +10:00
2019-07-03 22:37:19 +02:00
2018-10-19 11:01:33 +11:00
2019-07-30 11:11:16 +02:00
2018-06-21 18:55:08 +02:00
2018-06-21 18:55:08 +02:00
2019-07-30 11:10:54 +02:00
2019-05-01 21:29:05 +10:00
2018-06-21 18:55:08 +02:00
2018-06-21 18:55:08 +02:00
2018-10-19 11:01:33 +11:00
2019-08-27 14:34:01 +10:00
2018-06-21 18:55:08 +02:00
2019-07-03 22:37:19 +02:00
2018-06-21 18:55:08 +02:00
2019-09-06 19:46:19 +10:00
2019-09-06 15:51:02 +10:00
2019-09-06 15:51:02 +10:00
2019-09-06 15:51:02 +10:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2018-06-21 18:55:08 +02:00
2018-06-21 18:55:08 +02:00
2019-09-14 00:03:44 +10:00
2019-10-15 17:48:36 +11:00
2019-08-20 19:02:57 +10:00
2019-09-13 20:03:01 +10:00
2019-09-13 20:03:01 +10:00
2019-09-13 20:03:01 +10:00
2019-09-13 20:03:01 +10:00
2019-09-13 20:03:01 +10:00
2019-09-13 20:03:01 +10:00
2019-07-03 22:37:19 +02:00
2019-09-14 00:03:44 +10:00
2018-06-21 18:55:08 +02:00
2018-06-21 18:55:08 +02:00
2018-06-21 18:55:08 +02:00
2019-06-27 02:10:50 +10:00
2019-10-08 21:36:11 +11:00
2019-10-17 17:56:14 +11:00
2019-09-09 10:47:48 +10:00
2019-09-13 15:51:02 +10:00
2019-06-26 23:41:16 +02:00
2019-06-26 23:41:16 +02:00
2019-06-26 23:41:16 +02:00
2019-08-27 14:34:01 +10:00
2019-07-03 22:37:19 +02:00
2019-07-03 22:37:19 +02:00
2019-09-09 10:47:48 +10:00
2018-10-19 11:01:33 +11:00
2019-10-16 17:35:14 +11:00
2019-07-03 22:37:19 +02:00
2019-09-14 00:03:44 +10:00
2019-07-03 22:37:19 +02:00
2018-06-21 18:55:08 +02:00
2019-04-23 01:12:27 +00:00
2019-09-25 08:58:15 +10:00
2019-09-14 00:03:44 +10:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2018-06-21 18:55:08 +02:00
2018-06-21 18:55:08 +02:00
2019-07-03 22:37:19 +02:00
2019-10-15 17:48:36 +11:00
2019-10-17 16:12:50 +11:00
2019-10-15 17:48:36 +11:00
2019-10-15 17:48:36 +11:00
2018-06-21 18:55:08 +02:00