The hot code path in internalization checks to see if update.updateFromExternalObject wants a "dataserver" keyword or a "context" or nothing. This has a few problems:
- Checking the argspec is insanely slow. In one test, it was 5.28us, vs checking an
isinstance which clocked in at around 200ns. That's 26x slower. (I was able to get rid of argspec there, but I don't know if I can do that here while preserving compatibility.)
- A dataserver argument doesn't make any sense.
- There's a fallback path that passes nothing if we can't be exactly sure what the signature is.
This all needs to be simplified, starting with dropping the dataserver argument, and then maybe requiring everyone to accept a context argument.
The hot code path in internalization checks to see if
update.updateFromExternalObjectwants a "dataserver" keyword or a "context" or nothing. This has a few problems:isinstancewhich clocked in at around 200ns. That's 26x slower. (I was able to get rid of argspec there, but I don't know if I can do that here while preserving compatibility.)This all needs to be simplified, starting with dropping the
dataserverargument, and then maybe requiring everyone to accept acontextargument.