diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-01-01 16:09:01 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2021-12-17 21:29:05 +0100 |
commit | 76fa211620de167b76846f0e5db5b64b8756ad48 (patch) | |
tree | c435dbf6585b3758dc78ee82bf114e162a25d0e1 /test/orm/test_merge.py | |
parent | 3543fcc9c9601e81560d055ceadaea05c75815c0 (diff) | |
download | sqlalchemy-workflow_test_cython.tar.gz |
Replace c extension with cython versions.workflow_test_cython
Re-implement c version immutabledict / processors / resultproxy / utils with cython.
Performance is in general in par or better than the c version
Added a collection module that has cython version of OrderedSet and IdentitySet
Added a new test/perf file to compare the implementations.
Run ``python test/perf/compiled_extensions.py all`` to execute the comparison test.
See results here: https://docs.google.com/document/d/1nOcDGojHRtXEkuy4vNXcW_XOJd9gqKhSeALGG3kYr6A/edit?usp=sharing
Fixes: #7256
Change-Id: I2930ef1894b5048210384728118e586e813f6a76
Signed-off-by: Federico Caselli <cfederico87@gmail.com>
Diffstat (limited to 'test/orm/test_merge.py')
-rw-r--r-- | test/orm/test_merge.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/orm/test_merge.py b/test/orm/test_merge.py index 8866223cc..0f29cfc56 100644 --- a/test/orm/test_merge.py +++ b/test/orm/test_merge.py @@ -31,10 +31,20 @@ from sqlalchemy.testing import not_in from sqlalchemy.testing.fixtures import fixture_session from sqlalchemy.testing.schema import Column from sqlalchemy.testing.schema import Table +from sqlalchemy.util import has_compiled_ext from sqlalchemy.util import OrderedSet from test.orm import _fixtures +if has_compiled_ext(): + # cython ordered set is immutable, subclass it with a python + # class so that its method can be replaced + _OrderedSet = OrderedSet + + class OrderedSet(_OrderedSet): + pass + + class MergeTest(_fixtures.FixtureTest): """Session.merge() functionality""" |