Skip to content

Conversation

@aljazerzen
Copy link
Contributor

Runtime type checking is a waste of performance. We have container types
(list, set, dict) that type check their contents as they are
constructed or modified.
This type-checking is disabled at runtime (by substituting _check_type
method for _identity), but there is still some overhead of these
container types even existing.

This PR aims to remove these container types.

As the first step, i've disabled type checking entirely, to see if there
is any runtime mechanism relying on it.

Runtime type checking is a waste of performance. We have container types
(list, set, dict) that type check their contents as they are
constructed or modified.
This type-checking is disabled at runtime (by substituting `_check_type`
method for `_identity`), but there is still some overhead of these
container types even existing.

This PR aims to remove these container types.

As the first step, i've disabled type checking entirely, to see if there
is any runtime mechanism relying on it.
@msullivan
Copy link
Member

Looking good so far

@aljazerzen
Copy link
Contributor Author

I've paused here, because this will be easier to do when I remove schema reductions.

Another blocker that I have is that for schema fields, I cannot just replace CheckList[int] with list[int] because according to Python isinstance(list[int], type) == False. I guess I'll have to create class SchemaList[T](list[T]): pass and have special handling for it, just as we have it for CheckedList (and friends).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants