GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Specialize BINARY_SUBTRACT · Issue #100 · faster-cpython/ideas

Specialize BINARY_SUBTRACT #100

New issue
Copy link
New issue
Copy link
Closed
Closed
Specialize BINARY_SUBTRACT#100
Copy link

Description

@corona10
corona10
opened on Oct 17, 2021
Issue body actions

I would like to test that specializing BINARY_SUBTRACT is worth implementing.
I will leave an experiment result by referencing an already done task.

Experiment commit:
corona10/cpython@fb360a2
https://github.com/corona10/cpython/tree/BINARY_SUBTRACT_specialize

cc Thanks to Ken Jin's tutorial and Dennis's work, It was easy to follow up on how to implement this task.
Thank you again.

Reacted by Ken Jin

Activity

  1. corona10
    changed the title [-]Specialization BINARY_SUBTRACT[/-] [+]Specialize BINARY_SUBTRACT[/+] on Oct 17, 2021
  2. corona10 commented on Oct 17, 2021

    @corona10
    corona10
    on Oct 17, 2021
    Author
    More actions

    Environment: MS Azure D8s v3(8 vcpu, 32GiB Memory) -> FYI, non-isolated environment.
    I am waiting for @pablogsal 's isolated tests :) (Thanks Pablo!)

    fannkuch / nbody / richards become faster.

    Benchmark baseline specialize
    chaos 114 ms 112 ms: 1.02x faster
    crypto_pyaes 131 ms 128 ms: 1.02x faster
    deltablue 7.57 ms 7.72 ms: 1.02x slower
    django_template 64.0 ms 63.5 ms: 1.01x faster
    dulwich_log 106 ms 105 ms: 1.01x faster
    fannkuch 617 ms 593 ms: 1.04x faster
    float 131 ms 132 ms: 1.01x slower
    go 252 ms 251 ms: 1.00x faster
    json_dumps 18.1 ms 18.3 ms: 1.01x slower
    json_loads 39.2 us 39.8 us: 1.01x slower
    logging_format 12.3 us 12.4 us: 1.01x slower
    logging_silent 191 ns 195 ns: 1.02x slower
    mako 19.6 ms 20.0 ms: 1.02x slower
    meteor_contest 144 ms 145 ms: 1.01x slower
    nbody 173 ms 164 ms: 1.05x faster
    nqueens 134 ms 132 ms: 1.01x faster
    pathlib 31.4 ms 31.6 ms: 1.00x slower
    pickle_dict 37.2 us 37.8 us: 1.02x slower
    pickle_list 5.85 us 5.77 us: 1.01x faster
    pidigits 254 ms 254 ms: 1.00x faster
    pyflate 802 ms 792 ms: 1.01x faster
    python_startup 12.1 ms 12.1 ms: 1.01x slower
    raytrace 524 ms 521 ms: 1.01x faster
    regex_dna 268 ms 266 ms: 1.01x faster
    regex_effbot 4.16 ms 4.14 ms: 1.00x faster
    regex_v8 31.9 ms 31.8 ms: 1.00x faster
    richards 87.6 ms 91.6 ms: 1.05x slower
    scimark_fft 516 ms 495 ms: 1.04x faster
    scimark_lu 224 ms 219 ms: 1.02x faster
    scimark_monte_carlo 110 ms 109 ms: 1.01x faster
    scimark_sor 225 ms 235 ms: 1.04x slower
    spectral_norm 177 ms 175 ms: 1.01x faster
    sympy_integrate 32.1 ms 32.5 ms: 1.01x slower
    sympy_sum 257 ms 258 ms: 1.00x slower
    sympy_str 456 ms 458 ms: 1.00x slower
    unpack_sequence 56.2 ns 54.9 ns: 1.02x faster
    unpickle 21.3 us 21.7 us: 1.02x slower
    unpickle_list 6.56 us 6.65 us: 1.01x slower
    unpickle_pure_python 417 us 413 us: 1.01x faster
    xml_etree_process 96.3 ms 96.8 ms: 1.01x slower
    Geometric mean (ref) 1.00x faster

    Benchmark hidden because not significant (16): 2to3, chameleon, hexiom, logging_simple, pickle, pickle_pure_python, python_startup_no_site, regex_compile, scimark_sparse_mat_mult, sqlite_synth, sympy_expand, telco, tornado_http, xml_etree_parse, xml_etree_iterparse, xml_etree_generate

  3. corona10 commented on Oct 17, 2021

    @corona10
    corona10
    on Oct 17, 2021
    Author
    More actions

    fannkuch

        binary_add.specialization_success : 44
        binary_add.specialization_failure : 5
        binary_add.hit : 6930513
        binary_add.deferred : 318
        binary_add.miss : 28
        binary_add.deopt : 6
        binary_add.unquickened : 191
    
        binary_multiply.specialization_success : 12
        binary_multiply.specialization_failure : 8
        binary_multiply.hit : 288
        binary_multiply.deferred : 198
        binary_multiply.miss : 0
        binary_multiply.deopt : 0
        binary_multiply.unquickened : 83
    
        binary_subtract.specialization_success : 27
        binary_subtract.specialization_failure : 5
        binary_subtract.hit : 1043817
        binary_subtract.deferred : 244
        binary_subtract.miss : 0
        binary_subtract.deopt : 0
        binary_subtract.unquickened : 75
    
    

    nbody

        binary_add.specialization_success : 49
        binary_add.specialization_failure : 5
        binary_add.hit : 1605746
        binary_add.deferred : 318
        binary_add.miss : 28
        binary_add.deopt : 6
        binary_add.unquickened : 220
    
        binary_multiply.specialization_success : 38
        binary_multiply.specialization_failure : 8
        binary_multiply.hit : 10800700
        binary_multiply.deferred : 200
        binary_multiply.miss : 0
        binary_multiply.deopt : 0
        binary_multiply.unquickened : 231
    
        binary_subtract.specialization_success : 32
        binary_subtract.specialization_failure : 5
        binary_subtract.hit : 2401427
        binary_subtract.deferred : 244
        binary_subtract.miss : 0
        binary_subtract.deopt : 0
        binary_subtract.unquickened : 104
    

    raytrace

        binary_add.specialization_success : 346
        binary_add.specialization_failure : 2219
        binary_add.hit : 4462044
        binary_add.deferred : 159961
        binary_add.miss : 394452
        binary_add.deopt : 289
        binary_add.unquickened : 363
    
        binary_multiply.specialization_success : 15739
        binary_multiply.specialization_failure : 10779
        binary_multiply.hit : 7814370
        binary_multiply.deferred : 1694199
        binary_multiply.miss : 376198
        binary_multiply.deopt : 15703
        binary_multiply.unquickened : 274
    
    
        binary_subtract.specialization_success : 16807
        binary_subtract.specialization_failure : 42058
        binary_subtract.hit : 2128006
        binary_subtract.deferred : 3763883
        binary_subtract.miss : 325179
        binary_subtract.deopt : 16760
        binary_subtract.unquickened : 239
    
  4. pablogsal commented on Oct 18, 2021

    @pablogsal
    pablogsal
    on Oct 18, 2021
    Collaborator
    More actions

    Results on my benchmark machines:

    ❯ pyperf compare_to json/* --table --table-format=md -G

    Benchmark 2021-10-17_12-06-main-b3f0ceae919c 2021-10-17_17-39-binary-subscript
    regex_effbot 4.05 ms 3.75 ms: 1.08x faster
    unpack_sequence 63.4 ns 59.9 ns: 1.06x faster
    regex_dna 270 ms 258 ms: 1.05x faster
    regex_v8 30.8 ms 29.5 ms: 1.05x faster
    float 107 ms 103 ms: 1.04x faster
    chaos 95.0 ms 91.9 ms: 1.03x faster
    mako 17.4 ms 16.9 ms: 1.03x faster
    fannkuch 511 ms 500 ms: 1.02x faster
    pickle 13.4 us 13.2 us: 1.02x faster
    go 217 ms 213 ms: 1.02x faster
    hexiom 9.58 ms 9.41 ms: 1.02x faster
    unpickle_pure_python 343 us 337 us: 1.02x faster
    scimark_sor 189 ms 186 ms: 1.02x faster
    pickle_dict 36.9 us 36.3 us: 1.02x faster
    telco 7.68 ms 7.56 ms: 1.02x faster
    scimark_monte_carlo 96.4 ms 94.9 ms: 1.02x faster
    pyflate 663 ms 652 ms: 1.02x faster
    sqlite_synth 3.22 us 3.17 us: 1.01x faster
    xml_etree_process 79.8 ms 78.8 ms: 1.01x faster
    json_dumps 16.8 ms 16.6 ms: 1.01x faster
    dulwich_log 83.9 ms 83.2 ms: 1.01x faster
    crypto_pyaes 107 ms 106 ms: 1.01x faster
    sympy_integrate 27.3 ms 27.1 ms: 1.01x faster
    xml_etree_parse 188 ms 186 ms: 1.01x faster
    python_startup 11.5 ms 11.4 ms: 1.01x faster
    sympy_sum 212 ms 211 ms: 1.01x faster
    python_startup_no_site 8.48 ms 8.43 ms: 1.01x faster
    2to3 319 ms 318 ms: 1.00x faster
    pickle_pure_python 463 us 461 us: 1.00x faster
    pidigits 235 ms 235 ms: 1.00x slower
    meteor_contest 132 ms 133 ms: 1.00x slower
    deltablue 6.21 ms 6.24 ms: 1.00x slower
    sqlalchemy_imperative 22.6 ms 22.8 ms: 1.01x slower
    raytrace 413 ms 416 ms: 1.01x slower
    chameleon 9.84 ms 9.94 ms: 1.01x slower
    pathlib 20.8 ms 21.0 ms: 1.01x slower
    django_template 48.6 ms 49.2 ms: 1.01x slower
    pickle_list 5.30 us 5.37 us: 1.01x slower
    scimark_sparse_mat_mult 5.73 ms 5.83 ms: 1.02x slower
    nbody 136 ms 139 ms: 1.02x slower
    spectral_norm 138 ms 141 ms: 1.02x slower
    unpickle 16.3 us 16.8 us: 1.03x slower
    Geometric mean (ref) 1.01x faster

    Benchmark hidden because not significant (16): tornado_http, logging_format, sqlalchemy_declarative, logging_simple, xml_etree_iterparse, unpickle_list, xml_etree_generate, scimark_lu, logging_silent, scimark_fft, sympy_expand, nqueens, json_loads, richards, regex_compile, sympy_st

    ❯ pyperf system
    Show the system configuration
    Unit irqbalance.service could not be found.
    
    System state
    ============
    
    CPU: use 2 logical CPUs: 17,35
    Perf event: Maximum sample rate: 1 per second
    ASLR: Full randomization
    Linux scheduler: Isolated CPUs (2/36): 17,35
    Linux scheduler: RCU disabled on CPUs (2/36): 17,35
    CPU Frequency: 0-16,18-34=min=1200 MHz, max=3000 MHz; 17,35=min=max=3000 MHz
    CPU scaling governor (intel_pstate): performance
    Turbo Boost (intel_pstate): Turbo Boost disabled
    IRQ affinity: Default IRQ affinity: CPU 0-16,18-34
    IRQ affinity: IRQ affinity: IRQ 0,2=CPU 0-35; IRQ 1,3-16,21,25-31,56-59,68-85,87,89-90,92-93,95-104=CPU 0-16,18-34; IRQ 32=CPU 0,18; IRQ 33=CPU 1,19; IRQ 34=CPU 2,20; IRQ 35=CPU 3,21; IRQ 36=CPU 4,22; IRQ 37=CPU 5; IRQ 38=CPU 6; IRQ 39=CPU 7; IRQ 40=CPU 8; IRQ 41=CPU 9; IRQ 42=CPU 10; IRQ 43=CPU 11; IRQ 44=CPU 12; IRQ 45=CPU 13; IRQ 46=CPU 14; IRQ 47=CPU 15; IRQ 48=CPU 16; IRQ 49=CPU 17; IRQ 50=CPU 23; IRQ 51=CPU 24; IRQ 52=CPU 25; IRQ 53=CPU 26; IRQ 54=CPU 27; IRQ 55=CPU 28; IRQ 60=CPU 29; IRQ 61=CPU 30; IRQ 62=CPU 31; IRQ 63=CPU 32; IRQ 64=CPU 33; IRQ 65=CPU 34; IRQ 66=CPU 35
    
    OK! System ready for benchmarking
    
    Reacted by Donghee Na
    Reacted by Donghee Na
  5. markshannon commented on Oct 18, 2021

    @markshannon
    markshannon
    on Oct 18, 2021
    Member
    More actions

    See #101

  6. corona10
    closed this as completedon Nov 28, 2021
  7. gramster
    added this to Fancy CPython Boardon Jan 10, 2022
  8. gramster
    moved this to Todo in Fancy CPython Boardon Jan 10, 2022
  9. gramster
    moved this from Todo to Other in Fancy CPython Boardon Jan 10, 2022
  10. gramster
    removed this from Fancy CPython Boardon Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.