Changeset 220893 in webkit


Ignore:
Timestamp:
Aug 17, 2017 5:56:59 PM (7 years ago)
Author:
msaboff@apple.com
Message:

Add a Unicode test to RexBench that matches non-BMP characters
https://bugs.webkit.org/show_bug.cgi?id=175697

Reviewed by JF Bastien.

Added a new sub test that simulates 5 card stud poker. This test uses the Unicode playing
cards code points, U+1F0A1..U+1F0DE, as the card representation. The scoring of hands is
done using three regular expressions, one to check for a flush, one to check for straights
and one to check for pairs, three of a kind and four of a kind.

  • RexBench/UniPoker: Added.
  • RexBench/UniPoker/benchmark.js: Added.

(UniPokerBenchmark):
(UniPokerBenchmark.prototype.setup.):
(UniPokerBenchmark.prototype.setup.Math.random):
(UniPokerBenchmark.prototype.setup):
(UniPokerBenchmark.prototype.runOnce):
(UniPokerBenchmark.prototype.validate):

  • RexBench/UniPoker/expected.js: Added.

(PlayerExpectation):
(PlayerExpectation.prototype.validate):

  • RexBench/UniPoker/poker.js: Added.

(CardDeck):
(CardDeck.prototype.newDeck):
(CardDeck.prototype.shuffle):
(CardDeck.prototype.dealOneCard):
(CardDeck.cardRank):
(CardDeck.cardName):
(Hand):
(Hand.prototype.clear):
(Hand.prototype.takeCard):
(Hand.prototype.score):
(Hand.prototype.get rank):
(Hand.prototype.toString):
(Player):
(Player.prototype.scoreHand):
(Player.prototype.wonHand):
(Player.prototype.get name):
(Player.prototype.get hand):
(Player.prototype.get wins):
(Player.prototype.get handTypeCounts):
(playHands):

  • RexBench/about.html:
  • RexBench/cli.js:
  • RexBench/glue.js:

(driver.reportResult):

  • RexBench/index.html:
  • RexBench/unipoker_benchmark.js: Added.
Location:
trunk/PerformanceTests
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r220801 r220893  
     12017-08-17  Michael Saboff  <msaboff@apple.com>
     2
     3        Add a Unicode test to RexBench that matches non-BMP characters
     4        https://bugs.webkit.org/show_bug.cgi?id=175697
     5
     6        Reviewed by JF Bastien.
     7
     8        Added a new sub test that simulates 5 card stud poker.  This test uses the Unicode playing
     9        cards code points, U+1F0A1..U+1F0DE, as the card representation.  The scoring of hands is
     10        done using three regular expressions, one to check for a flush, one to check for straights
     11        and one to check for pairs, three of a kind and four of a kind.
     12
     13        * RexBench/UniPoker: Added.
     14        * RexBench/UniPoker/benchmark.js: Added.
     15        (UniPokerBenchmark):
     16        (UniPokerBenchmark.prototype.setup.):
     17        (UniPokerBenchmark.prototype.setup.Math.random):
     18        (UniPokerBenchmark.prototype.setup):
     19        (UniPokerBenchmark.prototype.runOnce):
     20        (UniPokerBenchmark.prototype.validate):
     21        * RexBench/UniPoker/expected.js: Added.
     22        (PlayerExpectation):
     23        (PlayerExpectation.prototype.validate):
     24        * RexBench/UniPoker/poker.js: Added.
     25        (CardDeck):
     26        (CardDeck.prototype.newDeck):
     27        (CardDeck.prototype.shuffle):
     28        (CardDeck.prototype.dealOneCard):
     29        (CardDeck.cardRank):
     30        (CardDeck.cardName):
     31        (Hand):
     32        (Hand.prototype.clear):
     33        (Hand.prototype.takeCard):
     34        (Hand.prototype.score):
     35        (Hand.prototype.get rank):
     36        (Hand.prototype.toString):
     37        (Player):
     38        (Player.prototype.scoreHand):
     39        (Player.prototype.wonHand):
     40        (Player.prototype.get name):
     41        (Player.prototype.get hand):
     42        (Player.prototype.get wins):
     43        (Player.prototype.get handTypeCounts):
     44        (playHands):
     45        * RexBench/about.html:
     46        * RexBench/cli.js:
     47        * RexBench/glue.js:
     48        (driver.reportResult):
     49        * RexBench/index.html:
     50        * RexBench/unipoker_benchmark.js: Added.
     51
    1522017-08-16  Mathias Bynens  <mathias@qiwi.be>
    253
  • trunk/PerformanceTests/RexBench/about.html

    r220752 r220893  
    2525        <p>Offline Assembler is the lexer, parser and AST layer of the offline assembler for JavaScriptCore.  It has been ported to JavaScript from the original Ruby.</p>
    2626
     27        <p>UniPoker is a 5 card stud poker simulation using the Unicode playing cards code points, U+1F0A1..U+1F0DE, as the card representation in the code.  Scoring of hands is done with three regular expressions, one to check for a flush, one to check for straights, and one to check for pairs, three of a kind and four of a kind.  The last regular expression is used twice as needed to find hands with 2 pairs or a full house.
     28
    2729        <p>Flight Planner is a newly written benchmark taken from a flight management web application.  Flight Planner parses aircraft flight plans and computes distance, course and elapsed times for legs of flight plans as well as total time.  It uses FAA data for airports, navigation aids and airways.  The flight management app was originally written to help compete in a flying proficiency event.  See <a href="http://www.hwdairrally.org/index.shtml">Hayward Air Rally</a>.
    2830        </p>
  • trunk/PerformanceTests/RexBench/cli.js

    r220752 r220893  
    5454load("basic_benchmark.js");
    5555load("offline_assembler_benchmark.js");
     56load("unipoker_benchmark.js");
    5657load("flightplan_benchmark.js");
    5758load("flightplan_unicode_benchmark.js");
  • trunk/PerformanceTests/RexBench/glue.js

    r220752 r220893  
    4040
    4141{
    42     const title = "RexBench 0.92";
     42    const title = "RexBench 0.93";
    4343    if (isInBrowser) {
    4444        document.title = title;
     
    5252driver.addBenchmark(BasicBenchmarkRunner);
    5353driver.addBenchmark(OfflineAssemblerBenchmarkRunner);
     54driver.addBenchmark(UniPokerBenchmarkRunner);
    5455driver.addBenchmark(FlightPlannerBenchmarkRunner);
    5556driver.addBenchmark(FlightPlannerUnicodeBenchmarkRunner);
  • trunk/PerformanceTests/RexBench/index.html

    r220752 r220893  
    141141        </div>
    142142
     143        <div class="unipoker test">
     144            <h2 id="UniPokerMessage">UniPoker</h2>
     145           
     146            <div class="score">
     147                <label>First Iteration</label>
     148                <span id="UniPokerFirstIteration">
     149                    <span class="value">0</span><span class="units">ms</span>                   
     150                </span>
     151            </div>
     152 
     153            <div class="score">
     154                <label>Worst 4 Iteratons</label>
     155                <span id="UniPokerAverageWorstCase">
     156                    <span class="value">0</span><span class="units">ms</span>                   
     157                </span>
     158            </div>
     159
     160            <div class="score">
     161                <label>Average</label>
     162                <span id="UniPokerSteadyState">
     163                    <span class="value">0</span><span class="units">ms</span>                   
     164                </span>
     165            </div>
     166        </div>
     167
    143168        <div class="flight planner test">
    144169            <h2 id="FlightPlannerMessage">Flight Planner</h2>
     
    199224    <script src="basic_benchmark.js"></script>
    200225    <script src="offline_assembler_benchmark.js"></script>
     226    <script src="unipoker_benchmark.js"></script>
    201227    <script src="flightplan_benchmark.js"></script>
    202228    <script src="flightplan_unicode_benchmark.js"></script>
Note: See TracChangeset for help on using the changeset viewer.