𝗙𝘂𝗻 𝘁𝗶𝗺𝗲 𝘄𝗶𝘁𝗵 𝗽𝘆𝗼𝟯 Optimize embedded Python in rust is not trivial. At first, I managed to make calls to a Flask webapp from my WSGI enabled server in rust. Today I finally managed to run 𝗼𝗵𝗮 and check performance. Well, it not ended as expected, I got only 300 req/s. Then I moved code which required Python GIL out of request handler, at this point numbers went up, with 3200 req/s. Now I’m going avoid acquire GIL more than once, hope this number goes up several times more. My goal is 80000 req/s, and with that, another post, will all steps need to make this happen. Want to keep up to date with rust 🦀? Follow me or connect 🔗 If you enjoyed this post, like 👍, or comment 💬, or repost ♻️ #rust #python #embed #performance #pyo3 #interop #vetis #scripting
Rogério Pereira Araujo, MBA’s Post
More Relevant Posts
-
Every Python developer has faced this at least once. You clone a repository. Follow the README step by step. And then… ModuleNotFoundError After dealing with this problem one too many times, I built SafeENV - a simple CLI tool that fixes Python environments automatically. What it does: • Creates virtual environments • Detects dependencies from your code • Installs missing packages • Repairs broken setups All with a few simple commands like: safeenv setup safeenv doctor safeenv fix The goal is simple: Spend less time fixing environments and more time writing code. 🔗 GitHub: https://lnkd.in/g6SwBYBR 🌐 Website: https://lnkd.in/gGZ-VxdH 📦 PyPI: https://lnkd.in/gq5Y5E6z Would love feedback . #Python #OpenSource #DeveloperTools #CLI
To view or add a comment, sign in
-
-
Have you tried using PyO3? It is a library that helps integrate Rust with Python. It allows you to either expose Rust code as a Python extension module or embed the Python interpreter directly into a Rust application. A common usecase is when you have built your application in Python and start running into bottlenecks. Because Python being a dynamically typed interpreted language running on the GIL, has inherent performance limitations. I am sure some of you out there have already ran into it. Rust can give you a significant uplift here. Rather than rewriting the entire program, you profile your Python application, rewrite the hot paths in Rust, compile it as a native extension, and let the Python interpreter consume it seamlessly. Libraries like Polars and Pydantic V2 are great real-world examples of this pattern. In HFT systems built in Rust, the usecase flips. You want the strategies and algorithms written in Python because they are easier to iterate on, backtest, and hand off to quants. But the execution layer needs to be fast and deterministic which is happening in microseconds. Here you embed the Python interpreter into the Rust binary, load your core algorithm logic at runtime, and let the Rust runtime drive execution while calling into Python only when needed. It's fun to do this! PyO3 paired with Maturin (for build tooling) makes both of these workflows surprisingly ergonomic. How effectively have you used PyO3 in your projects or organizations? . . . . #rust #python #pyo3 #HFT #programming
To view or add a comment, sign in
-
-
PyPI Maintainers Discourage Non-Python Binaries on Package Index 📌 PyPI maintainers are drawing a hard line against using the Python Package Index as a dumping ground for non-Python binaries-like Go, Rust, or CMake tools-hiding inside Python wheels. While technically possible, this trend threatens PyPI’s core purpose as a Python-distribution platform, risking scalability issues and security complications, and the community is urging developers to use dedicated tools instead for non-Python assets. 🔗 Read more: https://lnkd.in/dGXcQ2FY #Pypi #Pythonwheel #Pypa #Binarydistribution #Packagingecosystem
To view or add a comment, sign in
-
🚀 I just published my first Python package to PyPI: QuickQRForge This project started as a learning exercise to better understand Python packaging, distribution, and building developer-friendly CLI tools. QuickQRForge is a simple Python library and CLI tool for generating QR codes quickly from the terminal or from within Python code. 🔧 Features: • Generate QR codes from URLs or text • Use it directly from the command line or as a tui • Import it as a Python library • Lightweight and simple to use 📦 Install from PyPI: pip install QuickQRForge Building this helped me learn more about: • Structuring Python packages • Publishing to PyPI • Designing CLI tools for developers If anyone wants to check it out or leave feedback, I'd appreciate it! 🔗 https://lnkd.in/guDimguk #Python #OpenSource #PyPI #LearningInPublic #DeveloperTools
To view or add a comment, sign in
-
-
Built a Personal Library Manager with Python + Streamlit! First 32s: Full code walkthrough (main.py + pyproject.toml) Last 33s: Live UI demo (Add books, Search, Stats, Export) Features: - Add books with Title, Author, Genre, Year, Pages - Inline editing with Read/Unread checkbox - Search by Title or Author instantly - Stats dashboard with genre bar chart - Export your entire library to CSV - Zero database needed - saves locally as CSV - No login, no cloud - 100% private Built with Python + Streamlit + Pandas + uv 106 lines of code. Zero backend. Works offline. This is the kind of tool I use personally - simple, fast, no unnecessary complexity. #Python #Streamlit #Pandas #BuildInPublic #100DaysOfCode #TechPakistan #Programming #OpenSource
Personal Library Manager - Python + Streamlit
To view or add a comment, sign in
-
🚀 Python 3.14 — Back to the Interpreter. Back to the Basics. Today I went back to where everything starts: An Informal Introduction to Python. https://lnkd.in/d4NN7cmG # Launch Python 3.14 explicitly (Windows launcher) C:\Users\John> py -3.14 # This is a comment → ignored by Python # Remember. This is a comment. # This is NOT a comment because it's inside quotes text = "# This is not a comment." # Addition 7 + 4 # Subtraction 50 - 37 # Order of operations (multiplication first) (100 - 5 * 7) # True division → float 17 / 3 # Floor division → integer 17 // 3 # Modulo → remainder 17 % 3 # Exponentiation 2 ** 10 # Store resolution values width = 1920 height = 1080 # Calculate total pixels (Full HD) width * height 💥 Fail Fast # Access undefined variable size → NameError 🔁 REPL Superpower: _ # `_` holds the last result in interactive mode width - _ 🎯 My Take Deep systems aren’t built on complexity. They’re built on mastery of fundamentals. Whether you’re building: A Django backend A distributed system An AI-powered application It all starts here — with clean thinking. “If you want to fly high, take a deep dive.” #Python #Django #Backend #SoftwareDevelopment #DeepDive
To view or add a comment, sign in
-
🚀 Mini Project: Expense Tracker (Python Console Application) I’m excited to share my mini project — a simple Expense Tracker built using Python in VS Code. 🔹 This is a menu-driven console application that allows users to: • Add daily expenses (Date, Category, Description, Amount) • View all recorded expenses • Calculate total expenses • Exit the program safely This project helped me strengthen my understanding of Python fundamentals and improve my logical thinking while building a real-world problem-solving application. 🎯 Tools Used: Python VS Code Looking forward to feedback and suggestions to improve it further! 😊 #Python #BeginnerProject #CodingJourney #VSCode #LearningByDoing #MiniProject
To view or add a comment, sign in
-
🚀 Most Python APIs fail because of performance and scalability - not code. After building and optimizing multiple backend systems, I realized many developers struggle with the same FastAPI mistakes. So I wrote a complete 2026 guide on building high-performance Python APIs with FastAPI - covering: ✅ Clean project structure ✅ Async best practices ✅ Authentication & security ✅ Performance optimization ✅ Production deployment ✅ Real-world examples If you’re serious about building APIs that scale, this will save you months of trial and error. 📖 Read it here: 👉 https://lnkd.in/gyW8RtRV What’s the biggest challenge you face with APIs right now? Let’s discuss 👇💬 #Python #FastAPI #BackendDevelopment #WebDevelopment #APIs #SoftwareEngineering #TechBlog
To view or add a comment, sign in
-
-
As of v29, SQLGlot has dropped Rust in favor of C... 🦀 🪦. For a while, SQLGlot's tokenizer had a Rust implementation. It was fast. But it had a dirty secret: it was a manually-maintained copy of the Python code. Every time we changed the Python tokenizer, someone had to remember to update Rust too. The build system was fragile. Releases required manual tagging. With v29, we've replaced the Rust tokenizer with a mypyc compiled C extension. Now, we're compiling the actual Python source code. No duplication or separate build process. mypyc takes typed Python and compiles it to C. We get the speed benefits of C without abandoning the Python that makes SQLGlot easy to contribute to. The Rust tokenizer was always a workaround for Python's speed. mypyc allows us to get close to native speed while allowing us to keep things simple in a dynamic language. Change your requirements.txt from sqlglot[rs] to sqlglot[c] to enjoy a 40% parsing speed improvement. RIP 🦀 ... you served us well. #sqlglot #rust #mypy
To view or add a comment, sign in
-
-
I’ll admit it: early in my Python journey, I spent hours debugging code that looked fine. Functions returning the wrong value, variables mysteriously “disappearing,” and weird side effects… all because I didn’t fully understand Python variable scope. Once I got it, my code became cleaner, easier to debug, and way more predictable. I turned that hard-earned lesson into a short, practical guide that walks you through local, global, and nonlocal variables with real examples. 👉 Check it out here: https://lnkd.in/djp6HJdD If you’re serious about improving your Python fundamentals, this guide is a simple way to save hours of frustration. #Python #LearnPython #CodingTips
To view or add a comment, sign in
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development