Skip to content

Commit

Permalink
Change memory limited types for <integer>
Browse files Browse the repository at this point in the history
Changing the type of memory cells and memory pointer from limited type
to an integer boost performace by ~50% in bench.b and ~20% on mandelbrot.b.
  • Loading branch information
fraya committed May 9, 2024
1 parent 80a6ed8 commit 4329395
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/memory.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ define constant $memory-size
= 30000;

define constant <memory-cell>
= limited(<integer>);
= <integer>;

define constant <memory-cells>
= limited(<vector>, of: <memory-cell>, size: $memory-size);

define constant <memory-pointer>
= limited(<integer>, min: 0, max: $memory-size);
= <integer>;

define class <memory> (<object>)
constant slot memory-cells :: <memory-cells> = make(<memory-cells>, fill: 0),
Expand Down

0 comments on commit 4329395

Please sign in to comment.