r/Python • u/AdMammoth8075 • 11d ago
News I Built A C++ Powered Python Library Using pybind11 - way faster than python loops
[removed]
0
Upvotes
r/Python • u/AdMammoth8075 • 11d ago
[removed]
•
u/AutoModerator 9d ago
Your submission has been automatically queued for manual review by the moderation team because it has been reported too many times.
Please wait until the moderation team reviews your post.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
7
u/PLPeeters 11d ago
Not to burst your bubble, but did you benchmark it against
list(dict.fromkeys(items))instead of an explicit Python loop?dict.fromkeys()is already implemented in C in CPython, preserves insertion order, and avoids the Python-to-C++ type conversion overhead introduced by pybind11.0
u/[deleted] 11d ago
[removed] — view removed comment