Python 3.15 might be shipping one of the most exciting performance tools Python has added in a while, that too right after the GIL-free release. It is called Tachyon. Python is adding a new statistical sampling profiler under `profiling.sampling` called Tachyon, and the positioning is what caught my attention: - attach to a running Python process - no code changes - no restart - designed for low-overhead profiling - supports outputs like flamegraphs, speedscope-compatible stacks, Firefox Profiler, heatmaps, live TUI, async-aware views, and even opcode-level profiling The docs go even further and describe it as capable of sampling at up to 1,000,000 Hz and suitable for production performance debugging. With ML pipeline domination and RESTful servers now written increasingly in Python, this profiler will be a great addition. No longer will the notion of “run a profiler locally and hope the issue reproduces” carry on, and profiling becomes a first-class citizen, as in languages like Java. This is from the Python 3.15 alpha docs, so details may change before final release. But this is absolutely worth watching. A big thanks to the Python Software Foundation and Hugo van Kemenade for the updates and articles. Read more in the link below: https://lnkd.in/eUJ3C4N7 #Python #Python315 #Performance #Profiling #SystemsEngineering #Observability #Backend #SoftwareEngineering
Python 3.15 Tachyon Profiler: Low-Overhead Sampling
More Relevant Posts
-
𝗕𝗮𝗰𝗸𝗲𝗻𝗱 𝗹𝗲𝘀𝘀𝗼𝗻𝘀, 𝘂𝗻𝗳𝗶𝗹𝘁𝗲𝗿𝗲𝗱 I added logging to my Python app and thought I was done. Two lessons later — I wasn't even started. 𝗟𝗲𝘀𝘀𝗼𝗻 𝟭 : 𝘆𝗼𝘂𝗿 𝗹𝗼𝗴 𝗳𝗶𝗹𝗲 𝗶𝘀 𝗮 𝘁𝗶𝗰𝗸𝗶𝗻𝗴 𝗯𝗼𝗺𝗯 No size limit. No rotation. No cleanup. It just grows. Forever. Dev - fine. Production - it silently eats your disk until your app is down at 2AM. One swap in Python's standard library fixes this. Max size. Backup count. Auto-rotates. Auto-deletes oldest. That's it. 𝗟𝗲𝘀𝘀𝗼𝗻 𝟮 : 𝘆𝗼𝘂𝗿 𝗹𝗼𝗴𝘀 𝗮𝗿𝗲 𝘂𝗻𝗿𝗲𝗮𝗱𝗮𝗯𝗹𝗲 𝗮𝘁 𝘀𝗰𝗮𝗹𝗲 🔍 Human-readable text is perfect for dev. In production with thousands of requests ⁉️ Useless. Switch to JSON logs. Every line becomes a structured event : timestamp, level, request_id, user_id. Want all errors from one specific request? One query. Done. No regex. No grepping through walls of text. The difference between logging and logging for production is bigger than I thought. That gap - that's what this series is about #Python #Backend #LearnInPublic #SoftwareEngineering
To view or add a comment, sign in
-
I wish I knew these Python tips earlier. Here are some simple but powerful tricks every developer should know: 1. Swap variables without temp variable a, b = b, a 2. List comprehension (clean & fast) squares = [x*x for x in range(5)] 3. Use enumerate() instead of manual index for i, val in enumerate(list): 4. Use zip() to iterate multiple lists for a, b in zip(list1, list2): 5. Use set() to remove duplicates unique = list(set(data)) 6. Dictionary get() to avoid errors value = my_dict.get("key", "default") These small tricks make your code: -- Cleaner -- Faster -- More Pythonic Python is simple—but writing clean Python is a skill. Which tip did you already know? #Python #Backend #Python_Developer #Programming #DeveloperTips #Coding #SoftwareEngineering #FastAPI #Flask #Django
To view or add a comment, sign in
-
-
Built a small but useful Python tool: **jsonlens** While working with APIs, I kept running into the same issue: * Huge JSON responses * Deep nesting * Hard to extract what actually matters * And sometimes you can’t even share the data (privacy/security) So I built a simple utility that converts JSON into a clean structure: * Detects optional fields (`email?`) * Merges type variations (`int | str`) * Compresses repeated list structures * Removes actual values → safe to share Example: Input → messy API response Output → clean, readable structure Published it on PyPI so it’s easy to use: ```bash pip install jsonlens ``` Still improving it (thinking of adding CLI + type generation next). Would love feedback or ideas 🙌 #PyPi #package #python #genai
To view or add a comment, sign in
-
-
Fundamentals… Many of us are avid users of the Python Pandas library. The read_csv function is the basic step in reading data. After data is read, the most basic model to create is a simple linear regression model. While we (including myself) deal with the abstracted form of these functions, in a learning curve, it is imperative we understand what happens at the basic level. And when dealing with programming at the basic level, then it is not far fetched to bring the C language into discussion. Learning C is fun, it tires you out sometimes, specially when you’ve learnt C++, Python and Java beforehand, C is still important. While writing this subroutine, I was able to think from a fundamental perspective as to how, FILE input is read, how to escape string delimiters, how to read integer input, perform operations on it to build a function, we use so widely. Read the code, and you’ll understand, how memory allocation is being done depending on the file, how operations are formed and stored to be reused, what is scope and what would happen in variables are accessed outside of scope. Learning the fundamentals not only helps you in becoming better engineers but also lets you think in a manner where you can solve problems at the basic level without a lot of overhead. P.S( The code might replicate the initial functionality, but it still doesn’t work a optimally, but it does provide a fundamental layout, suggestions and improvements are always welcome). Link: https://lnkd.in/ggPaeRx2 #opensource #C #programming #fundamentals #learninpublic
To view or add a comment, sign in
-
-
Most Python developers stop learning after `for` loops and list comprehensions. And honestly… Python lets you get away with it for a long time. But once you start writing real systems, things change. You suddenly hear words like: Decorators Generators Dataclasses Multiprocessing Caching And that moment hits you: “Wait… Python can do that?” So I put together a Python Advanced Cheat Sheet that covers some powerful concepts developers should know once they move beyond beginner scripts. Inside the cheat sheet: • Generators for memory-efficient pipelines • Decorators to extend function behavior • Dataclasses to reduce boilerplate • Multiprocessing to utilize CPU cores • Caching techniques to speed up heavy computations Because writing Python is easy. Writing good Python is a different skill. And let’s be honest… Most of us started Python with: `print("Hello World")` …and somehow ended up debugging why our decorator is wrapping another decorator. If you're learning Python or leveling up your coding skills, this cheat sheet might help. Free Python Advanced Cheat Sheet in the post below. Save it for later. It might come in handy during your next debugging session. #Python #PythonProgramming #Programming #SoftwareEngineering #Coding #Developers #LearnToCode #TechEducation
To view or add a comment, sign in
-
Python Tuples — Quick Guide with Examples A tuple in Python is an ordered, immutable collection that allows duplicate values. Once created, you cannot modify its elements. Creating a Tuple t = (10, 20, 30) Single element tuple (comma is required) t = (5,) Accessing elements t = (10, 20, 30) print(t[0]) # 10 Tuple slicing t = (1, 2, 3, 4) print(t[1:3]) # (2, 3) Tuple concatenation t1 = (1, 2) t2 = (3, 4) print(t1 + t2) Tuple unpacking person = ("John", 25, "Analyst") name, age, role = person Key Features: ✔ Ordered ✔ Immutable ✔ Allows duplicates ✔ Faster than lists ✔ Can store multiple data types When to use tuples? Use tuples when data should not change — like coordinates, database records, fixed configurations, etc. #Python #PythonBasics #DataStructures #Tuple #Coding #LearnPython #Programming #PythonForBeginners
To view or add a comment, sign in
-
Tips for larger Python programs! (I am not referring to small scripts, but program that are over 20,000) lines of code! 1 - modularize your design, this means split it into different python files for the different functional parts of your overall program! SUPER Important! 2 - if you cram everything into a single python file - maintenance will be a nightmare! How are you going to find anything ? the Human brain has limitation in very large program files no matter how smart you are! It doesn't matter if you have 50 years of experience or even if you invented the language! 3 - compiling a single large python file into a C code to protect you IP will take a very long time to run as the GCC compiler has limitations! even if you have a powerful computer - the rule is 1 python file to 1 core when compiling, you can not split that into Parallel, which will take forever to compile and you will waste a lot of time!!! 4 - after implementing modules, implement a Cache system / example you have 20 modules, but only made change to 1 Python file, why would you recompile the other 19 if there was zero change ? "BIG waste of time" and Unproductive! 5 - I written this, not used AI #python #tips #large #programs
To view or add a comment, sign in
-
Last week, the popular Python llm client library: litellm got hit by a supply chain attack[1]. Yesterday, it was the popular JS/TS HTTP client library axios[2]. If you’re doing any development / vibe-coding on your machine, a simple heuristic to avoid compromising it is to not install the latest versions of packages. Waiting 7 days is a reasonable tradeoff. The conservative bet is that any supply chain attacks on packages will be discovered and mitigated within a week. Package managers like uv (Python), and npm, pnpm (JS/TS) natively support this: uv: Add the following line to ~/.config/uv/uv.toml exclude-newer = "7 days" If you’re still using pip, you might want to consider using either uv’s pip interface “uv pip” or pipask instead. npm: Add the following to ~/.npmrc min-release-age=7 pnpm: Run pnpm update -rLi --config.minimum-release-age=10080 # 10,080 minutes in 7 days Or add the following to your pnpm-workspace.yaml file: minimumReleaseAge: 10080 [1]: https://lnkd.in/de8Pjztp [2]: https://lnkd.in/de8fhtH7
To view or add a comment, sign in
-
🧠 Python Concept: any() vs all() (Advanced Use) Write cleaner condition checks 😎 ❌ Traditional Way numbers = [2, 4, 6, 8] all_even = True for num in numbers: if num % 2 != 0: all_even = False break print(all_even) ❌ Problem 👉 Extra variables 👉 More lines 👉 Less readable ✅ Pythonic Way numbers = [2, 4, 6, 8] all_even = all(num % 2 == 0 for num in numbers) print(all_even) 🧒 Simple Explanation Think of: 👉 all() = “Everything must be True” ✅ 👉 any() = “At least one is True” ⚡ 💡 Why This Matters ✔ Cleaner conditions ✔ No flags needed ✔ Very readable logic ✔ Used in validations & filters ⚡ Bonus Examples names = ["Alice", "Bob", "Charlie"] print(any(name.startswith("A") for name in names)) 👉 Output: True nums = [1, 2, 3] print(all(num > 0 for num in nums)) 👉 Output: True 🐍 Think less, write smarter 🐍 Let Python handle logic #Python #PythonTips #CleanCode #LearnPython #Programming #DeveloperLife #100DaysOfCode
To view or add a comment, sign in
-
-
🐍 Day 26 of My 30-Day Python Learning Challenge 🚀 Today I enhanced my Log File Analyzer Project by adding a new feature. 📌 New Feature: Top N Words (User Choice) Instead of showing only top 3 words, users can now choose how many top words they want. 📌 Code: top_n = int(input("Enter number of top words: ")) top_words = sorted(word_count.items(), key=lambda x: x[1], reverse=True)[:top_n] print(top_words) --- 📊 What Changed? • Before → Fixed output (Top 3 words) • Now → Dynamic output (User-defined) --- 💡 Why this matters? • Makes the project flexible • Improves user experience • Closer to real-world applications --- 📊 Quick Question What will happen if user enters a very large number? A) Error B) Full list is returned C) Empty output D) Program stops Answer tomorrow 👇 #Python #MiniProject #ProjectEnhancement #LearningInPublic #SoftwareDeveloper
To view or add a comment, sign in
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