|
|
Up |
|
|
  |
Author: Marcel HendrixMarcel Hendrix Date: Jan 13, 2007 09:58
Albert van der Horst writes Re: meteor benchmark
> I see that the meteor benchmark runs 14 minutes
> (ciforth, Pentium I 90) against the pentomino program
> 2.5 minutes.
Status from:
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=meteor&lang=all
meteor-contest (new) benchmark
Ratio Program & Logs Full CPU Time s
1.0 Lua LuaJIT #2 1.44
1.9 Lua LuaJIT 2.68
2.1 Lua #2 3.00
4.1 D Digital Mars #2 5.88
4.3 Lua 6.24
5.6 Forth bigForth 8.02
6.6 Oberon-2 OO2C 9.55
These benchmarks were run on a a single-processor 2GHz Intel Pentium 4 machine
with 512MB of RAM and an 80GB IDE disk drive.
|
| Show full article (1.10Kb) |
|
| | no comments |
|
  |
Author: Marcel HendrixMarcel Hendrix Date: Jan 14, 2007 04:52
> Here are the results (user time in seconds on a 2.26GHz Pentium 4):
> meteor code
> old new System
> 32.21 32.20 Debian gforth
> 23.43 23.43 Debian gforth-fast
> 9.01 8.98 well-compiled gforth
> 4.88 4.80 well-compiled gforth-fast
> 5.99 3.21 bigforth 2.1.6
> 8.60 4.11 iforth 2.0.257
> Hmm, Marcel achieved 0.791s on a 3GHz machine with slight
> optimizations for iForth; these "slight optimizations" (over the old
> code) appear to give about a factor of 8 speedup.
The current version is iForth version 2.1.2509, you are a bit behind
there. With the current version code/data separation is not an issue
anymore. Also I have succumbed to benchmark pressure and implemented
auto-inlining.
|
| Show full article (1.09Kb) |
|
| | no comments |
|
  |
Author: Ian OsgoodIan Osgood Date: Jan 25, 2007 16:42
On Jan 25, 10:38 am, m...@iae.nl (Marcel Hendrix) wrote:
> "Ian Osgood" quirkster.com> writes Re: meteor benchmark
> [..]
>
>> I had some more ideas, mostly for code reduction, but maybe they are
>> also faster.
>> 1. Calculate absolute shift on the stack, eliminating "shift" and
>> "adjust":Could you please post your modified store-solution mark solve
> put-piece fill-leading and unshift-board again? just plugging them
> in the default meteor_josh2 code doesn't work for me (wrong print outs,
> sometimes correct counts). I saw speedups in the 50 ms region for
> store-solution and mark (enough to beat Lua ;-)
>
> -marcel
Sorry, you also need the following post because I swapped the
parameters to put-piece.
In any case, I uploaded Grams' island code and my optimizations to the
shootout, where it is 39%% faster than the previous version, but with
the same code size.
|
| Show full article (1.42Kb) |
| no comments |
|
  |
Author: Ian OsgoodIan Osgood Date: Jan 25, 2007 16:44
On Jan 25, 10:38 am, m...@iae.nl (Marcel Hendrix) wrote:
> "Ian Osgood" quirkster.com> writes Re: meteor benchmark
> [..]
>
>> I had some more ideas, mostly for code reduction, but maybe they are
>> also faster.
>> 1. Calculate absolute shift on the stack, eliminating "shift" and
>> "adjust":Could you please post your modified store-solution mark solve
> put-piece fill-leading and unshift-board again? just plugging them
> in the default meteor_josh2 code doesn't work for me (wrong print outs,
> sometimes correct counts). I saw speedups in the 50 ms region for
> store-solution and mark (enough to beat Lua ;-)
>
> -marcel
Oh, and my fill-leading idea was bogus. I should have tested it more
thoroughly.
Ian
|
| |
| no comments |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Jan 13, 2007 05:16
I see that the meteor benchmark runs 14 minutes
(ciforth, Pentium I 90) against the pentomino program
2.5 minutes.
It is my estimation that both are about equally complex.
That would mean that introducing the bit field techniques from
mpent.frt could mean a speedup of upto a factor 5.
An advantage is that such techniques are not easily copied
by other computer languages.
A large part of my mpent.frt can be copied verbatim. The generation of
the bit-maps is different, and the meteor problem require that
different bit-maps are used in odd and even rows, but this doesn't
cost more time.
I'll see what I can do.
Groetjes Albert
|
| |
| 32 Comments |
|
  |
Author: Anton ErtlAnton Ertl Date: Jan 14, 2007 02:56
>mhx@iae.nl (Marcel Hendrix) writes:
>> meteor-contest (new) benchmark
>>
>>Ratio Program & Logs Full CPU Time s
>...
>> 5.6 Forth bigForth 8.02
>
>Taking the code from the contest site and running it on a 2.26GHz
>Pentium 4 with a well-compiled Gforth, I see
>
>real 0m4.841s
>user 0m4.817s
>
>So this appears to be another one of those cases where bigForth trips
>over its mixing of data and code (pretty easy on Pentium 4).
|
| Show full article (1.98Kb) |
| 26 Comments |
|
  |
Author: John RibleJohn Rible Date: Jan 14, 2007 20:47
Albert van der Horst wrote:
> ...
>
> What I do in mpent.frt is to shift the double containing the unfilled
> squares up, and have shifted patterns for the upper row
> only. Using a double with unfilled squares has the advantage of
> doing away with the border problem. A piece only fits if its and
> with the unfilled pattern is equal to itself.
>
> Good luck!
The approach I've looked at uses:
A 64-bit double for the board, with a single end-of-row bit, filled with 1's at the end. Row 0 is bits 0-5, row 9 bits 54-59. Zero for empty, 1 for filled/fence. As rows are filled, arithmetic rshift fills upper bits with 1's. done when board is -1. slower to backtrack.
24 32-bit masks for the pieces (all orientations fit in 5 rows): separate sets for odd & even rows, 1 for filled, 0 for empty. AND of piece to board is 32-bit zero if it fits. Only need to check 32 bits of board. XOR piece to place it, XOR to remove it when backtracking.
Unresolved issue:
pruning/backtracking beyond the simplest. There may be an optimal order to testing the pieces in their various orientations to help this.
Maybe this will suggest speed-ups to the folks participating.
John Rible
|
| |
| 24 Comments |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Jan 20, 2007 05:10
In article ,
Albert van der Horst wrote:
>I see that the meteor benchmark runs 14 minutes
>(ciforth, Pentium I 90) against the pentomino program
>2.5 minutes.
>
>It is my estimation that both are about equally complex.
>That would mean that introducing the bit field techniques from
>mpent.frt could mean a speedup of upto a factor 5.
Not so. But I have a meteor.frt that runs 4:50 which is three
times as fast. All measured on ciforth Pentium 90.
The following is ciforth specific, however I hope that the
technique used is sufficiently clear from the comment to be of
use.
So code follows here. Don't expect it to run on your Forth.
\ Copyright : Albert van der Horst by Gnu Public Licence
\ $Id: meteor.frt,v 1.14 2007/01/20 12:05:22 albert Exp $
\ Uses Stallman convention for comment.
|
| Show full article (13.52Kb) |
| 1 Comment |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Jan 20, 2007 10:20
In article ,
Albert van der Horst wrote:
>3. Have them sorted, don't output or remember any thing,
> however discard solutions where the leftmost corner belongs to
> a higher piece than the rightmost corner.
>
> Output count * 2.
> This symmetry argument has the potential of cutting
> the running time in two.
Oeps!
There is a better more straightforward way.
Don't flip.
Have turn3 besides turn6.
: turn3 3 0 DO add snug1 add turn LOOP ;
Now redefine the bit-masks of piece p0.
This eliminates the orientations of p0 that are flipped version
flopped version or flipflopped version of other orientations
that are already there.
p0 &0 extract !orient ( !) turn3 add-pip
|
| Show full article (1.42Kb) |
| no comments |
|
  |
|
|
  |
Author: Marcel HendrixMarcel Hendrix Date: Jan 21, 2007 03:45
Albert van der Horst writes Re: 2 improvements Re: meteor benchmark
> In article , Albert van der Horst wrote:
[..]
> Not so. But I have a meteor.frt that runs 4:50 which is three
> times as fast. All measured on ciforth Pentium 90.
[..]
The BAG construct looks useful.
> \ The piece class. No data, it is filled immediately while it is still current.
> class PIECE
> LATEST pieces BAG+! \ Register
> M: orientations M; \ :BAG with all orientations snug, and snug1.
> M: !orient !BAG M; \ Clear orientations it.
> M: add @bits SWAP SET+ M; \ Add orientation from ``buffer''.
> 24 BUILD-BAG \ 12 snug and 12 snug1 orientations.
> M: pip M; \ :POINTER to bags with piece-in-position masks.
> M: pip[] SWAP TH @ M; \ For position N, return nth BAG with pips.
> build-pip
> endclass
Thank you for reminding me why I hate object-oriented programming :-)
|
| Show full article (1.40Kb) |
| 1 Comment |
|
RELATED THREADS |
  |
|
|
|
|
|