Commit a72e23ea authored by Robert Bradshaw's avatar Robert Bradshaw

Document use_switch directive.

parent 2e0c27f6
......@@ -13,6 +13,9 @@ Features added
annotations. Currently requires setting the compiler directive
``annotation_typing=True``.
* Added directive use_switch (defaults to True) to optionally enable
the chained if statement to switch statement optimization.
Bugs fixed
----------
......
......@@ -388,6 +388,13 @@ Cython code. Here is the list of currently supported directives:
``unraisable_tracebacks`` (True / False)
Whether to print tracebacks when suppressing unraisable exceptions.
``use_switch`` (True / False)
Whether to expand chained if-else statements (including statements like
``if x == 1 or x == 2:``) into C switch statements. This can have performance
benefits if there are lots of values but cause compiler errors if there are any
duplicate values (which may not be detectable at Cython compile time for all
C constants).
How to set directives
---------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment