Skip to content

Instantly share code, notes, and snippets.

@japhb
Created November 13, 2011 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save japhb/1361357 to your computer and use it in GitHub Desktop.
Save japhb/1361357 to your computer and use it in GitHub Desktop.
Current snapshot of Str.Numeric() rewrite stress test
# 'old' is current Rakudo nom implementation of Str.Numeric()
# 'new' is WIP rewrite
# Time to complete tight loop of .Numeric() calls
PERF TEST Δt-old = 7.82440400123596
PERF TEST Δt-new = 10.397479057312
# Comparison of conversion quality; ideal is diagonal matrix.
# 'new' returns Num when it cannot fit the parsed result into
# Int or Rat; when bigint branch merges, this can be fixed.
# The 'other' column for the 'old' implementation turns out
# to be when it outright throws an Exception.
--- old ---
WANTED Int Rat Num Failure other TOTAL
Int 372 - 24 195 - 591
Rat - 612 - 984 210 1806
Num 2 - 31132 6 - 31140
Failure 34 - - 394 - 428
TOTAL - - - - - 33965
--- new ---
WANTED Int Rat Num Failure other TOTAL
Int 555 - 36 - - 591
Rat - 1416 390 - - 1806
Num - - 31140 - - 31140
Failure - - - 428 - 428
TOTAL - - - - - 33965
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment