1
Vote

pybench 2.0 does not work

description


PYBENCH 2.0

  • using IronPython 2.7.2 (IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.237 (64-bit))
    <string>:1: RuntimeWarning: IronPython has no support for disabling the GC
  • disabled garbage collection
  • Python version doesn't support sys.setcheckinterval
  • using timer: time.time
     
    Creating benchmark: c:\Users\USER\Desktop\ipybench.pybench (rounds=10, warp=10)
     
    Calibrating tests. Please wait... done.
     
    Running 10 round(s) of the suite at warp factor 10:
     
    Traceback (most recent call last):
    File "pybench.py", line 959, in <module>
    File "c:\Users\USER\Code\pybench\CommandLine.py", line 345, in init
    File "pybench.py", line 926, in main
    File "pybench.py", line 543, in run
    File "c:\Users\USER\Code\pybench\pybench.py", line 325, in run
    File "c:\Users\USER\Code\pybench\Unicode.py", line 482, in test
    Exception: Exception of type 'System.Exception' was thrown.

comments

slide_o_mix wrote Jun 16, 2012 at 9:38 PM

It seems like unicodedata is not doing exactly what is expected

public static int digit(char unichr, int? @default = null)
    {
        try
        {
            int? d = GetInfo(unichr).Numeric_Value_Digit;
            if(d.HasValue)
            {
                return d.Value;
            }
            else
            {
                if(@default.HasValue)
                    return @default.Value;
                else
                    throw new Exception();
            }
        }
        catch(KeyNotFoundException)
        {
            if(@default.HasValue)
                return @default.Value;
            else
                throw new Exception();
        }
    }
The code that is throwing the exception is

digit(c, None) where digit is unicodedata.digit

From the Python docs, if a default is provided, it should be returned if the character is undefined.

'Returns the digit value assigned to the Unicode character unichr as integer. If no such value is defined, default is returned, or, if not given, ValueError is raised.'

slide_o_mix wrote Jun 20, 2012 at 2:36 PM

With https://github.com/IronLanguages/main/pull/74 this is partially fixed. Once these items are pulled in there is still an issue with the return value from time.clock() that pybench is not liking.

PYBENCH 2.0

  • using IronPython 2.9.9a0 (IronPython 2.9.9a0 DEBUG (2.9.0.0) on .NET 4.0.30319
    .237 (64-bit))
    <string>:1: RuntimeWarning: IronPython has no support for disabling the GC
  • disabled garbage collection
  • Python version doesn't support sys.setcheckinterval
  • using timer: time.time
Creating benchmark: C:\Users\USER\Desktop\ipy.pybench (rounds=10, warp=10)

Calibrating tests. Please wait... done.

Running 10 round(s) of the suite at warp factor 10:
  • Round 1 done in 16.879 seconds.
    Traceback (most recent call last):
    File "C:\Users\USER\Code\pybench\pybench.py", line 959, in <module>
    File "C:\Users\USER\Code\pybench\CommandLine.py", line 345, in init
    File "C:\Users\USER\Code\pybench\pybench.py", line 926, in main
    File "C:\Users\USER\Code\pybench\pybench.py", line 543, in run
    File "C:\Users\USER\Code\pybench\pybench.py", line 328, in run
    ValueError: warp factor too high: test times are < 10ms