90 Commits

Author SHA1 Message Date
Kay Hayen
718ab60539 Bump copyright year 2025-04-28 11:04:36 +02:00
Kay Hayen
6b9cfac217 Optimization: More dual types work
* This creates working code for most tests

* New templates for dual types comparisons and binary operations

* Also starting unary operation shape analysis, so we can complete number operations

* Also 3.13 compatibility work for No-GIL
2024-12-18 11:10:34 +01:00
Kay Hayen
95db1c2872 Tests: Change this construct test to clearer structure as well 2024-12-18 11:10:21 +01:00
Kay Hayen
c8da894285 Tests: Enhanced more construct tests
* Lower the impact of module variable usages
2024-12-18 11:10:21 +01:00
Kay Hayen
0c85e97097 Tests: Enhanced attribute lookup test
* Make it independent of the module variable access
2024-12-18 11:10:21 +01:00
Kay Hayen
274dcf04fb Tests: Enhanced closure variable test construct too
* Do not use module variable writing to test it, instead
  use it locally instead.
2024-12-18 11:10:21 +01:00
Kay Hayen
4a0a21ff98 Tests: Remove 2to3 conversion code, we don't want to use it anymore 2024-12-18 11:10:21 +01:00
Kay Hayen
fa08f31203 Tests: Make testing of local variable performance independent of module variable performance 2024-12-18 11:10:21 +01:00
Kay Hayen
e91edd7b9c Tests: Enhanced comparison construct tests
* Was dependent on module variable performance and covered int rather than str

* Added both in and str tests that are more clearly separating the operation in question.
2024-12-18 11:10:21 +01:00
Kay Hayen
e85ee78560 Tests: Added test case for harder to cache global variable accesses
* If updates to module variables occur that change the value, only
  Python 3.11+ can handle it.
2024-12-18 11:10:21 +01:00
Kay Hayen
0b6492ed07 Tests: Needs less iterations to be effective 2024-12-18 11:10:11 +01:00
Kay Hayen
44f575c69e Tests: Make sure the global variable test doesn't suffer from optimization possibilities as much 2024-12-18 11:09:55 +01:00
Kay Hayen
a614249d33 TODO: Unpacking from tuples and lists should be tested too 2024-12-18 11:09:55 +01:00
Kay Hayen
636ccb2416 Tests: Added construct based tests for coroutines
* Improved related function and generator tests too
2024-12-18 11:08:18 +01:00
Kay Hayen
f34f8d0c63 Bump copyright year
* Also split copyright notices between the top and bottom,
  such that readability of just opened files is not harmed
  by license text.
2024-12-18 10:48:16 +01:00
Kay Hayen
72a2c05a63 Quality: Updated requirements
* New black removes a few leading new lines in blocks, so many
  files changed in that way.

* The "pygments" has a vulnerability, but updating that and the
  restructured text checking stuff did not actually matter at
  all.

* Bumped needed version for development to 3.8, since black does
  not do 3.7 anymore, and it's old enough.
2024-01-22 21:40:07 +01:00
Kay Hayen
909d41f02d Bump copyright year 2023-06-02 15:07:22 +02:00
Kay Hayen
ffc6da6725 Optimization: Faster list constant usage
* Small immutable constants get their own code that is faster for small
  sizes.

* Medium sized ones get code that just is hinted the size, but takes
  item from a source list.

* For repeated lists use a dedicated helper for all sizes, even faster.

* Only large constant lists get copied with generic code now.

* This should still retain or even improve C scalability, while we
  get a good performance boost out of this, 2%-20% depending on the
  cases.
2023-04-14 13:27:06 +02:00
Kay Hayen
050f6bc8d1 Tests: Minor cleanups
* This removes the micro benchmarks which are obsolete and should
  be using construct based tests if needed.
2023-02-13 14:20:27 +01:00
John Vandenberg
5d15c7c704 Quality: Update and expand auto-formatting tools
* Update auto-formatting tools with newest isort and rstfmt.

* Also format of "tests/*/*.rst" and many test files.
2023-02-13 14:20:27 +01:00
Kay Hayen
be992feca8 Optimization: Faster deep copy of mutable tuples and list constants
* With a bit of guidance, many checks can be avoided, example added
  speeds up from 137% to 201% with Python3.10

* Add our own "TUPLE_COPY" as well, as that is used in this deep copy.
2023-01-09 16:42:13 +01:00
Kay Hayen
857defa0b2 Tests: Always use no_site mode for construct tests
* Just get the "PYTHONPATH" from it, and then we are good
2023-01-09 16:42:12 +01:00
Kay Hayen
4cfdd9f9c0 Bump copyright year 2022-05-23 10:28:11 +02:00
Kay Hayen
c7583deb2e Optimization: Faster calls, esp. with keyword arguments
* Make sure specialized calls are also giving C functions SystemError in
  case they return NULL.

* Also make sure we use call code that takes advantage of tuple size
  knowledge for constant positional arguments.

* Check tuple size to catch errors in using the POSARGS tuple variants.

* Add specialization for keywords only and mixed calls for large gains
  as dictionaries might be avoided.

* Merge CompiledCodeHelpers and CompiledFunction for better friendship
  of code.

* For unknown called objects, use "tp_vectorcall" if available for 3.8
  or higher.

* Pass around argument and keyword value vectors as constant values, as
  these are not modified, might help compiler optimization.
2021-09-12 13:53:36 +02:00
Kay Hayen
0cfda4cee4 Tests: Add construct test for array construction 2021-09-12 13:53:36 +02:00
Kay Hayen
1ad5ea5902 Optimization: Faster fallback using constant value tuples in calls
* Avoid creating the constant tuple used to make the call when it is
  needed to call non-compiled code.

* This gains 10% on instance creations with 6 arguments, but should be
  most important when calling C functions.

* Also avoids tuples in cases where the internal API allows it, namely
  3.7 exactly.
2021-09-12 13:53:36 +02:00
Kay Hayen
7f2fee1e94 Tests: Add constructs for keyword calls too
* These are not yet well optimized and at least
  keyword + star arguments is slower.
2021-09-12 13:52:47 +02:00
Kay Hayen
df381e15ea Tests: Added construct test for half sided float add
* This is different from the others, both should exist.
2021-03-28 09:47:23 +02:00
Kay Hayen
f2ac32ff48 Tests: Make sure construct tests can actually benefit from actual inplace 2021-03-13 11:28:34 +01:00
Kay Hayen
ec636dbf72 Tests: Added Python2 only long inplace operation test 2021-03-05 20:38:13 +01:00
Kay Hayen
e43b72e087 Bump copyright year to 2021. 2021-01-22 09:58:00 +01:00
Kay Hayen
69a03bcec9 Tests: Enhanced construct tests
* More avoidance of global variable accesses.
2020-12-07 08:29:01 +01:00
Kay Hayen
4cdb45ff99 Tests: Enhanced constructs
* Avoid measuring global variable access performance.

* Other cleanups
2020-12-05 18:14:10 +01:00
Kay Hayen
ff9ee581c8 Tests: Remove useless test case
* We don't have an alternative that could demonstrate performance of
  actually assigning, because for many operations, etc. void is now
  a different operation.
2020-05-10 15:52:43 +02:00
Kay Hayen
b2083575cf Bump copyright year to 2020. 2020-02-01 07:42:45 +01:00
Kay Hayen
47c99d377e Bump copyright year to 2019. 2019-01-24 16:28:13 +01:00
Kay Hayen
7b364e3df8 Optimization: Add in-place optimization for module variables too.
* These have a different reference count to consider for extending
  the value, pass this as an argument.

* This also splits unary and binary operation code generation which
  is overdue too.

* Avoids assigning back to module dict if the value didn't change.

* More work is needed for this to be actually effective for all
  helper kinds, and esp. for Python3 unicode.

* For some in-place operations, support for writing module variables
  has been added, including avoiding unnecessary write backs.
2018-10-03 10:30:51 +02:00
Kay Hayen
72c017355a Cleanup, make construct runner visible top level. 2018-09-18 08:32:18 +02:00
Kay Hayen
314f254ffe Tests: Improve construct tests for some operations examined. 2018-09-13 19:12:57 +02:00
Kay Hayen
01328c22d3 UI: Added option to choose binary filename for accelerated executables.
* Also defaults changes for standalone, non-Windows, use no suffix, and
  follow platform conventions inside the ".dist" folder.

* For accelerated mode, use ".exe" on Windows only, and change to ".bin"
  on others, which still avoids collisions, but is less confusion and
  now can be overriden with "-o" option.
2018-09-13 19:12:57 +02:00
Kay Hayen
62a483e466 Standalone: Do not preserve permissions of DLLs and extension modules.
* Deleting read only files is an extra hurdle on Windows, and this
  avoids it.

* Copying file permissions is not needed and wastes only time. A
  few places were already using "copyfile", but many were using
  "copy" for no reason.

* This should handle cases, where overwriting DLLs failed on Windows
  due to not being able to delete the ".dist" folder.
2018-08-23 20:04:34 +02:00
Kay Hayen
c02d3244ac Tests: Avoid using --python-version in tests.
* There are better ways to achieve this anyway.
2018-04-30 09:46:54 +02:00
Kay Hayen
3957ee8628 Updated copyright year to 2018. 2018-04-30 09:46:54 +02:00
Kay Hayen
c17f53afc7 Python2.6: Use common code "check_output"
* Only part of the tools and test code was working with Python2.6, and
  some parts were having their copies of that helper function still.

* This should enable more tools to work with Python 2.6 as their
  driver.
2017-07-10 09:22:10 +02:00
Kay Hayen
93b65b5812 Tests: Make separate Valgrind runner using common code.
* Added support for memory measurement to the common code as
  a mode.

* No need to not use unstripped at all when producing the binary,
  as it doesn't affect what "size" will say.

* Make output optional.

* Allow copying out the valgrind log file to a given filename, so
  kcachegrind can find it.
2017-07-01 09:23:01 +02:00
Kay Hayen
4759797d27 Tests: Make construct generation common code.
* This is to allow sharing it with the code that wants to
  render it for the speedcenter web site.

* Also move valgrind testing tool to that name space.
2017-07-01 09:23:01 +02:00
Kay Hayen
c55bb12f1e Tests: Improve valgrind runner a bit
* Use proper temp file name instead of derived name from test case.

* Make running valgrind to get a tick report a common tool code.

* Move "my_print" test function to utils code for reuse in tools.

* Added context manager to get temp filename to use.

* This is aiming at making construct running a proper tool too
  and merge with the interactive numbers / kcachegrind launching
  tool version.
2017-07-01 09:23:01 +02:00
Kay Hayen
44a556c364 Tests: Use more portable method to loop in construct tests. 2017-07-01 09:23:01 +02:00
Kay Hayen
519ccf1e3a Tests: Change all test runners to common tools code usage. 2017-02-16 08:24:24 +01:00
Kay Hayen
064df32ff0 Updated copyright year to 2017. 2017-01-09 07:25:38 +01:00