youtube / spitfire

A high-performance Python template language
BSD 3-Clause "New" or "Revised" License
403 stars 59 forks source link

Make C modules Python 3 compatible #76

Open trimbo opened 4 years ago

trimbo commented 4 years ago

_baked.c was the most complicated one. Py3 Unicode implementation requires initialization. I left the Python 2 implementation alone because I'm not entirely sure of the overhead being saved with memcpy right now.

trimbo commented 4 years ago

No detected performance regression with this.

New:

Spitfire template 9.65 ms Spitfire template -O1 8.18 ms Spitfire template -O2 5.70 ms Spitfire template -O3 5.74 ms Spitfire template baked 11.02 ms Spitfire template baked -O1 6.79 ms Spitfire template baked -O2 6.86 ms Spitfire template baked -O3 6.90 ms
Spitfire template unfiltered 5.71 ms
Spitfire template unfiltered -O1 2.19 ms Spitfire template unfiltered -O2 2.16 ms Spitfire template unfiltered -O3 2.11 ms

Old:

Spitfire template 9.84 ms Spitfire template -O1 8.37 ms
Spitfire template -O2 5.97 ms Spitfire template -O3 5.83 ms
Spitfire template baked 10.97 ms Spitfire template baked -O1 6.95 ms
Spitfire template baked -O2 6.85 ms
Spitfire template baked -O3 6.94 ms Spitfire template unfiltered 5.74 ms Spitfire template unfiltered -O1 2.16 ms Spitfire template unfiltered -O2 2.18 ms Spitfire template unfiltered -O3 2.13 ms