-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
While this has not been profiled, it seems rather unlikely that the python implementation uses the same allocator as Rust (whether system or other). This means *returning* a `String` is an extra allocation as that will need to be copied again to a `PyString` on the ouput. Which is just dumb. Copy the internal `Cow` directly to a `PyString` on output. On input, a `String` is necessary as there's no way to lifetime properly from Python, so the extractors need to be `'static`.
- Loading branch information
Showing
1 changed file
with
31 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters