Skip to content

How to shrink the size of the C API? Or at least, slow down its growth? #53

Description

@vstinner

A side question of issue #52 is: how can we slow down the growth of the C API?

Is there a way to add less functions or even stop adding functions?

Fixing the API requires to add variants of existing functions. Sometimes, the old APIs are deprecated and later removed, but the deprecation is slow: PEP 387 "Backwards Compatibility Policy".

See Statistics of the C API: Functions.

Functions (Python 3.6 => Python 3.12):

  • Public functions: 870 (3.6) => 966 (3.12): +96 functions (+11%).
  • Private functions:378 (3.6) => 378 (3.12): same! I suppose that this number is only stable thanks to the creation of the internal C API.
  • Internal C API: 0 (3.6) => 178 (3.12): +178 functions

Structures (Python 3.6 => Python 3.12):

  • Public structures: 110 (3.6) => 102 (3.12): -8 structures. Good! It's smaller! Again, I suppose that it's thanks to the internal C API.
  • Internal structures: 0 (3.6) => 170 (3.12): +170 structures

See also issue #39 "Supporting multiple ABI versions at once".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions