[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Dong-hee Na
Dong-hee Na added the comment: > https://github.com/brandtbucher/patmaperformance Nice benchmark suite, I will take a look :) -- ___ Python tracker ___

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Brandt Bucher
Brandt Bucher added the comment: I'm also in the process of creating some pattern matching benchmarks. You might find them useful for benching optimizations like this in the future: https://github.com/brandtbucher/patmaperformance In particular, I'm curious to see the impact of this change

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Brandt Bucher
Brandt Bucher added the comment: Thanks, this is awesome. FYI, there's probably more low-hanging fruit like this scattered about the pattern matching implementation. It's all very new code, mostly written by one person ;). (I wouldn't worry too much about the pattern compiler, though...

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Dong-hee Na
Dong-hee Na added the comment: For the record, Final benchmark with optimization build + thin LTO option. +---+---+--+ | Benchmark | thin_lto_base | thin_lto_opt | +===+===+==+ | bench pattern

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Dong-hee Na
Change by Dong-hee Na : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-30 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset e6497fe698f6e87344501a68ffdea106eafcb257 by Dong-hee Na in branch 'main': bpo-45045: Optimize mapping patterns of structural pattern matching (GH-28043) https://github.com/python/cpython/commit/e6497fe698f6e87344501a68ffdea106eafcb257 --

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-29 Thread Tim Peters
Change by Tim Peters : Removed file: https://bugs.python.org/file50242/runstack.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-29 Thread Tim Peters
Change by Tim Peters : -- Removed message: https://bugs.python.org/msg400568 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-29 Thread Tim Peters
Tim Peters added the comment: And another runstack.py adds `shivers4()`, which reworks `shivers3()` (length-adaptive ShiversSort) so that division, log2(), and floor() aren't used anymore. It does need a loop, though, which needs to go around a number of times `k` such that k is the

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-29 Thread Dong-hee Na
Dong-hee Na added the comment: With Ken Jin's suggestion +---++--+ | Benchmark | base | PR 28043 | +===++==+ | bench pattern | 482 ns | 373 ns: 1.29x faster |

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-29 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-29 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +26488 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28043 ___ Python tracker ___

[issue45045] Optimize mapping patterns of structural pattern matching

2021-08-29 Thread Dong-hee Na
New submission from Dong-hee Na : There are optimizable points that can be achieved by removing unnecessary tuple transformation and using vector calling convention. +---++--+ | Benchmark | base | opt |