From 55614d6799682c9658b4249c21f47a2ae7c07fe8 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Tue, 12 Sep 2023 08:49:41 +0200 Subject: [PATCH] Add profile=False to currently unprofiled cython --- spacy/attrs.pyx | 1 + spacy/lexeme.pyx | 1 + spacy/ml/parser_model.pyx | 1 + spacy/morphology.pyx | 1 + spacy/parts_of_speech.pyx | 2 +- spacy/pipeline/_edit_tree_internals/edit_trees.pyx | 1 + spacy/pipeline/_parser_internals/_state.pyx | 1 + spacy/pipeline/_parser_internals/ner.pyx | 1 + spacy/pipeline/_parser_internals/stateclass.pyx | 1 + spacy/pipeline/_parser_internals/transition_system.pyx | 1 + spacy/pipeline/transition_parser.pyx | 1 + spacy/strings.pyx | 1 + spacy/symbols.pyx | 1 + spacy/tokens/graph.pyx | 1 + spacy/tokens/morphanalysis.pyx | 1 + spacy/tokens/span.pyx | 1 + spacy/tokens/span_group.pyx | 1 + spacy/tokens/token.pyx | 1 + spacy/training/align.pyx | 1 + spacy/training/alignment_array.pyx | 1 + spacy/training/example.pyx | 1 + spacy/training/gold_io.pyx | 1 + spacy/typedefs.pyx | 1 + 23 files changed, 23 insertions(+), 1 deletion(-) diff --git a/spacy/attrs.pyx b/spacy/attrs.pyx index 97b5d5e36..363dd094d 100644 --- a/spacy/attrs.pyx +++ b/spacy/attrs.pyx @@ -1,3 +1,4 @@ +# cython: profile=False from .errors import Errors IOB_STRINGS = ("", "I", "O", "B") diff --git a/spacy/lexeme.pyx b/spacy/lexeme.pyx index 60d22e615..f803d5e93 100644 --- a/spacy/lexeme.pyx +++ b/spacy/lexeme.pyx @@ -1,4 +1,5 @@ # cython: embedsignature=True +# cython: profile=False # Compiler crashes on memory view coercion without this. Should report bug. cimport numpy as np from libc.string cimport memset diff --git a/spacy/ml/parser_model.pyx b/spacy/ml/parser_model.pyx index ae60972aa..f004c562e 100644 --- a/spacy/ml/parser_model.pyx +++ b/spacy/ml/parser_model.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True, cdivision=True, boundscheck=False +# cython: profile=False cimport numpy as np from libc.math cimport exp from libc.stdlib cimport calloc, free, realloc diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index ecbbed729..cef45b04d 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -1,4 +1,5 @@ # cython: infer_types +# cython: profile=False import warnings import numpy diff --git a/spacy/parts_of_speech.pyx b/spacy/parts_of_speech.pyx index e71fb917f..98e3570ec 100644 --- a/spacy/parts_of_speech.pyx +++ b/spacy/parts_of_speech.pyx @@ -1,4 +1,4 @@ - +# cython: profile=False IDS = { "": NO_TAG, "ADJ": ADJ, diff --git a/spacy/pipeline/_edit_tree_internals/edit_trees.pyx b/spacy/pipeline/_edit_tree_internals/edit_trees.pyx index 78cd25622..7abd9f2a6 100644 --- a/spacy/pipeline/_edit_tree_internals/edit_trees.pyx +++ b/spacy/pipeline/_edit_tree_internals/edit_trees.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True, binding=True +# cython: profile=False from cython.operator cimport dereference as deref from libc.stdint cimport UINT32_MAX, uint32_t from libc.string cimport memset diff --git a/spacy/pipeline/_parser_internals/_state.pyx b/spacy/pipeline/_parser_internals/_state.pyx index e69de29bb..61bf62038 100644 --- a/spacy/pipeline/_parser_internals/_state.pyx +++ b/spacy/pipeline/_parser_internals/_state.pyx @@ -0,0 +1 @@ +# cython: profile=False diff --git a/spacy/pipeline/_parser_internals/ner.pyx b/spacy/pipeline/_parser_internals/ner.pyx index 6c4f8e245..e4312bd2f 100644 --- a/spacy/pipeline/_parser_internals/ner.pyx +++ b/spacy/pipeline/_parser_internals/ner.pyx @@ -1,3 +1,4 @@ +# cython: profile=False from cymem.cymem cimport Pool from libc.stdint cimport int32_t diff --git a/spacy/pipeline/_parser_internals/stateclass.pyx b/spacy/pipeline/_parser_internals/stateclass.pyx index fdb5004bb..e3b063b7d 100644 --- a/spacy/pipeline/_parser_internals/stateclass.pyx +++ b/spacy/pipeline/_parser_internals/stateclass.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True +# cython: profile=False from libcpp.vector cimport vector from ...tokens.doc cimport Doc diff --git a/spacy/pipeline/_parser_internals/transition_system.pyx b/spacy/pipeline/_parser_internals/transition_system.pyx index aabbdfa24..e035053b3 100644 --- a/spacy/pipeline/_parser_internals/transition_system.pyx +++ b/spacy/pipeline/_parser_internals/transition_system.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True +# cython: profile=False from __future__ import print_function from cymem.cymem cimport Pool diff --git a/spacy/pipeline/transition_parser.pyx b/spacy/pipeline/transition_parser.pyx index 11c8fafc7..9a278fc13 100644 --- a/spacy/pipeline/transition_parser.pyx +++ b/spacy/pipeline/transition_parser.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True, cdivision=True, boundscheck=False, binding=True +# cython: profile=False from __future__ import print_function cimport numpy as np diff --git a/spacy/strings.pyx b/spacy/strings.pyx index b0799d6fc..376a13175 100644 --- a/spacy/strings.pyx +++ b/spacy/strings.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True +# cython: profile=False cimport cython from libc.stdint cimport uint32_t from libc.string cimport memcpy diff --git a/spacy/symbols.pyx b/spacy/symbols.pyx index d1deeb0e7..f7713577b 100644 --- a/spacy/symbols.pyx +++ b/spacy/symbols.pyx @@ -1,4 +1,5 @@ # cython: optimize.unpack_method_calls=False +# cython: profile=False IDS = { "": NIL, "IS_ALPHA": IS_ALPHA, diff --git a/spacy/tokens/graph.pyx b/spacy/tokens/graph.pyx index 1cbec09f4..6c4ce6ce3 100644 --- a/spacy/tokens/graph.pyx +++ b/spacy/tokens/graph.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True, cdivision=True, boundscheck=False, binding=True +# cython: profile=False from typing import Generator, List, Tuple cimport cython diff --git a/spacy/tokens/morphanalysis.pyx b/spacy/tokens/morphanalysis.pyx index ba7c638f6..ea5d07fa4 100644 --- a/spacy/tokens/morphanalysis.pyx +++ b/spacy/tokens/morphanalysis.pyx @@ -1,3 +1,4 @@ +# cython: profile=False cimport numpy as np from libc.string cimport memset diff --git a/spacy/tokens/span.pyx b/spacy/tokens/span.pyx index cf90e416b..af3ba8db5 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -1,3 +1,4 @@ +# cython: profile=False cimport numpy as np import copy diff --git a/spacy/tokens/span_group.pyx b/spacy/tokens/span_group.pyx index d245a1425..257c907bc 100644 --- a/spacy/tokens/span_group.pyx +++ b/spacy/tokens/span_group.pyx @@ -1,3 +1,4 @@ +# cython: profile=False import struct import weakref from copy import deepcopy diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index de967ba25..9fd4118d6 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -1,4 +1,5 @@ # cython: infer_types=True +# cython: profile=False # Compiler crashes on memory view coercion without this. Should report bug. cimport numpy as np diff --git a/spacy/training/align.pyx b/spacy/training/align.pyx index 79fec73c4..c68110e30 100644 --- a/spacy/training/align.pyx +++ b/spacy/training/align.pyx @@ -1,3 +1,4 @@ +# cython: profile=False import re from itertools import chain from typing import List, Tuple diff --git a/spacy/training/alignment_array.pyx b/spacy/training/alignment_array.pyx index b0be1512b..f0eb5cf39 100644 --- a/spacy/training/alignment_array.pyx +++ b/spacy/training/alignment_array.pyx @@ -1,3 +1,4 @@ +# cython: profile=False from typing import List import numpy diff --git a/spacy/training/example.pyx b/spacy/training/example.pyx index 3f0cf5ade..abdcecf71 100644 --- a/spacy/training/example.pyx +++ b/spacy/training/example.pyx @@ -1,3 +1,4 @@ +# cython: profile=False from collections.abc import Iterable as IterableInstance import numpy diff --git a/spacy/training/gold_io.pyx b/spacy/training/gold_io.pyx index 2fc36e41f..afbdf4631 100644 --- a/spacy/training/gold_io.pyx +++ b/spacy/training/gold_io.pyx @@ -1,3 +1,4 @@ +# cython: profile=False import warnings import srsly diff --git a/spacy/typedefs.pyx b/spacy/typedefs.pyx index e69de29bb..61bf62038 100644 --- a/spacy/typedefs.pyx +++ b/spacy/typedefs.pyx @@ -0,0 +1 @@ +# cython: profile=False