Commit Graph

31 Commits

Author SHA1 Message Date
Julien Fischer
2f13f76e98 Avoid warnings in extras and benchmarks.
benchmarks/prog/icfp2000_no_iostate/renderer.m:
    Avoid a warning about an unused module in ther interface.

extras/curs/curs.m:
    Delete an unused import.

extras/lex/lex.m:
    Replace state variables that are not updated.
2025-05-25 17:12:01 +10:00
Julien Fischer
253ca354f0 Avoid a warning.
benchmarks/progs/icfp2001/input.m:
    Avoid a warning about an unused import in the interface.
2023-06-25 03:10:12 +10:00
Zoltan Somogyi
dbb3171b61 Move training_cars_*.m to their own subdir. 2023-06-11 13:28:57 +02:00
Julien Fischer
2e3b656cff Fix compilation of benchmarks.
benchmarks/progs/*/*.m:
    Conform to library changes.
2022-06-08 22:15:19 +10:00
Julien Fischer
49c4dff4bd Add more integer to string benchmarks.
benchmarks/progs/integer_to_string/uint32_conversion.m:
benchmarks/progs/integer_to_string/uint64_conversion.m:
     As above.
2021-12-06 00:42:53 +11:00
Julien Fischer
b6d888a06e Add a benchmark for uint64 to string conversion.
benchmarks/progs/integer_to_string/uint64_conversion.m:
    As above.
2021-11-21 02:49:33 +11:00
Julien Fischer
cd540da1f2 Speed up uint32 to string conversion in C grades.
In C grades, uint32_to_string/1 is currently implemented by doing the
following:

 1. Calling sprintf() to write the string into a buffer on the stack.
 2. Calling strlen() on the buffer to determine the actual number of digits.
 3. Allocate the appropriate amount of space on the heap.
 4. Copying the string from the buffer on to the heap.

The benchmark included in this diff contains a number of alternative
implementations, all of which avoid much of the above overhead.
All of these implementations work by computing the required number of digits,
allocating space on the heap and then writing the digits into the string
backwards.

library/string.m:
    Replace uint32_to_string with a faster implementation.
    (This is alternative 1 in the benchmark program below.)

tests/hard_coded/Mmakefile:
tests/hard_coded/uint32_to_string.{m,exp}:
    A test of uint32 to string.

benchmarks/progs/integer_to_string/uint32_conversion.m:
    A program for benchmarking various uint32 to string conversion
    implementations.
2021-10-27 22:28:01 +11:00
Julien Fischer
05e16d889c Avoid potentially ambiguous pragmas in benchmarks.
benchmarks/*/*.m:
    As above.
2021-06-19 21:45:36 +10:00
Zoltan Somogyi
b5cad10f9a Update programming style. 2021-01-26 14:57:37 +11:00
Zoltan Somogyi
4910a8564d Update programming style. 2021-01-26 14:33:09 +11:00
Julien Fischer
c00b42ec3c Minor updates for benchmarks.
benchmarks/progs/tree234/tree234x.m:
benchmarks/progs/pic/mercury/utils.m:
     Replace uses of is a synonym for unification.

benchmarks/progs/training_cars/*.m:
     Delete implementation imports that shadow those in the interface.
2021-01-25 22:37:08 +11:00
Julien Fischer
a34150f6c9 Delete a comment.
benchmarks/progs/nbody/nbody_foreign.m:
   Delete a comment about supporting Erlang.
2020-10-29 23:52:01 +11:00
Peter Wang
8da4853b49 Update programs for getopt changes.
benchmarks/progs/icfp2000_par/main.m:
benchmarks/progs/mandelbrot/mandelbrot.m:
benchmarks/tools/log_to_r/log_to_r.m:
extras/align_right/align_right.m:
extras/error/error.m:
extras/gator/evolve.m:
extras/moose/options.m:
samples/concurrency/midimon/midimon.m:
samples/diff/diff.m:
samples/muz/muz.m:
    Conform to getopt.process_options now returning structured errors
    instead of strings.
2020-10-26 16:24:11 +11:00
Julien Fischer
f5fdc98426 Style updates for benchmarks and samples. 2020-05-20 17:06:20 +10:00
Julien Fischer
6add49696d Minor cleanups and updates for benchmarks.
benchmarks/progs/*:
   Delete redundant imports.

   Use typed insts.

   Replace the use of is/2.
2020-05-18 15:56:37 +10:00
Julien Fischer
7877594348 Avoid warnings in a benchmark.
benchmarks/progs/tree234/tree234x.m:
   As above.
2020-05-18 15:32:06 +10:00
Julien Fischer
83c236bbed Update one of the benchmarks.
benchmarks/progs/icfp2001/optimize.m:
     Replace a call to a now-deleted function.
2020-05-18 15:21:31 +10:00
Julien Fischer
74371800c6 Avoid warnings in benchmarks. 2020-05-17 01:49:43 +10:00
Julien Fischer
84e2536618 Fix minor compilation problems in extras and benchmarks.
These are due to:

- differences between module and file names.
- redundant imports
- the recent change from math.domain_error -> exception.domain_error.

benchmarks/*/*.m:
extras/*/*.m:
    As above.
2020-05-15 16:00:41 +10:00
Julien Fischer
9e939c724a Update code in benchmarks.
benchmarks/progs/icfp2000/test_eval.m:
    Conform to standard library changes.
2016-04-26 13:47:15 +10:00
Julien Fischer
2dc59fefbe Fix compilation errors in samples, extras and benchmarks.
benchmarks/progs/quicksort/qs_always_par.m:
benchmarks/progs/quicksort/qs_utils.m:
extras/moose/check.m:
extras/posix/samples/mdprof_cgid.m:
extras/xml/parsing.m:
samples/muz/zparser.m:
samples/muz/ztype_op.m:
    As above -- the compiler now rejects determinism declarations on
    non-predmode predicate declarations.

    Replace a call to bitmap.new with bitmap.init.
2016-01-13 14:16:24 +11:00
Julien Fischer
edd60810d4 Fix formatting in nbody benchmark.
benchmarks/progs/nbody/*.m:
    As above.
2015-12-04 14:25:59 +11:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Paul Bone
e3c2dfa344 Add a future data type for concurrent and parallel programming
library/library.m:
library/thread.future.m:
library/thread.m:
    Add new future standard library module.

NEWS:
    Announce the new addition.

library/thread.semaphore.m:
    Add an impure interface to thread.semaphore.m.  Semaphores are used to
    implement our other concurrency primitives and an impure interface can
    often be useful to implement things such as futures, which don't require
    IO state threading.  The impure interface predicate names are prefixed
    with "impure_".

library/thread.semaphore.m:
NEWS:
    Deprecate the impure init/1 function.

library/thread.mvar.m:
    Conform to changes in semaphore.m.

benchmarks/progs/mandelbrot/mandelbrot.m:
    Add future example to mandelbrot benchmark.
2014-10-10 00:57:36 +11:00
Paul Bone
bb6407adbe Add spawn and spawn_native parallelisations to the mandelbrot benchmark
The mandelbrot benchmark can now be used to benchmark concurrency support
using either spawn or spawn_native.  As before it can also use no
parallelism or the parallel conjunction operator.

benchmarks/progs/mandelbrot/mandelbrot.m:
    As above.

benchmarks/progs/mandelbrot/bench.sh:
    Update mandelbrot benchmarking script
2014-10-03 19:22:31 +10:00
Paul Bone
e6d0b4e994 Fix mandelbrot's --help message.
Fix a missing newline and document the --parallel option.

benchmarks/progs/mandelbrot/mandelbrot.m:
    As above.
2014-05-28 14:59:56 +10:00
Paul Bone
7a2396eec0 Add an option to mandelbrot to make it easier to test parallelism
Add a --parallel command line option to the mandelbrot benchmark that can be
given to use explicitly parallelised routines.  This makes it easier to turn
on and off explicit parallelism, depending on your testing needs.

benchmarks/progs/mandelbrot/mandelbrot.m:
    As above
2014-05-23 15:15:53 +10:00
Paul Bone
bc6682a07d Fix broken output in mandelbrot benchmark
This benchmark broke when unicode support was introduced.  It was fixed
once, but somehow seems to have reverted to its broken version (maybe when
we imported from CVS?).

benchmarks/progs/mandelbrot/mandelbrot.m:
    Re-fix the benchmark.
2013-06-24 22:11:32 +10:00
Julien Fischer
39c2f5abec Fix compilation warnings in benchmarks.
benchmarks/progs/compress/bmio.m:
benchmarks/progs/mandelbrot/mandelbrot.m:
	As above.

benchmarks/progs/compress/*.m:
	Update syntax used in these files: there are no
	changes to any algorithms.
2013-04-29 17:58:09 +10:00
Paul Bone
292d6463bd Rename .cvsignore files in the benchmarks directory.
benchmarks/progs/icfp2000_par/.cvsignore:
benchmarks/progs/icfp2000_par/.gitignore:
benchmarks/progs/icfp2000_par/examples/.cvsignore:
benchmarks/progs/icfp2000_par/examples/.gitignore:
    As above.
2013-01-04 12:14:12 +11:00
Paul Bone
ea06fd8cde Add the benchmarks directory into the main Mercury repository.
This was a seperate repository in CVS and so it missed the conversion.

benchmarks/
    As above.
2013-01-04 12:13:53 +11:00