Skip to content Skip to sidebar Skip to footer
Showing posts with the label Performance

Python Function Slows Down With Presence Of Large List

I was testing the speeds of a few different ways to do complex iterations over some of my data, and… Read more Python Function Slows Down With Presence Of Large List

Reading Huge File In Python

I have a 384MB text file with 50 million lines. Each line contains 2 space-separated integers: a ke… Read more Reading Huge File In Python

String Performance - Python 2.7 Vs Python 3.4 Under Windows 10 Vs. Ubuntu

Use case A simple function which checks if a specific string is in another string at a position whi… Read more String Performance - Python 2.7 Vs Python 3.4 Under Windows 10 Vs. Ubuntu

Marshal Dumps Faster, Cpickle Loads Faster

I'm implementing a program that needs to serialize and deserialize large objects, so I was maki… Read more Marshal Dumps Faster, Cpickle Loads Faster

Optimize Parsing File With Json Objects In Pandas Dataframe, Where Keys May Be Missing In Some Rows

I'm looking to optimize the code below which takes ~5 seconds, which is too slow for a file of … Read more Optimize Parsing File With Json Objects In Pandas Dataframe, Where Keys May Be Missing In Some Rows

Why Does This Python Multiprocessing Script Slow Down After A While?

Building on the script from this answer, I have the following scenario: A folder containing 2500 la… Read more Why Does This Python Multiprocessing Script Slow Down After A While?

Python - Efficient Function With Scipy Sparse Matrices

for a project, I need an efficient function in python that solves to following task: Given a very l… Read more Python - Efficient Function With Scipy Sparse Matrices

Ajax V. Including Data In The Html

I'm using JavaScript with jQuery, talking to a Django back end. There are some UI needs that re… Read more Ajax V. Including Data In The Html

Can The Order Of Code Make This Program Faster?

Hi this is my first post, I am learning how to write code so technically I am a newbie. I am learni… Read more Can The Order Of Code Make This Program Faster?

Fastest Way To Sort A Python 3.7+ Dictionary

Now that the insertion order of Python dictionaries is guaranteed starting in Python 3.7 (and in CP… Read more Fastest Way To Sort A Python 3.7+ Dictionary

Why Is Numpy List Access Slower Than Vanilla Python?

I was under the impression that numpy would be faster for list operations, but the following exampl… Read more Why Is Numpy List Access Slower Than Vanilla Python?

How To Update The Value Of A Key In A Json File Without Loading The Complete Json In Python?

Consider, the content of json file before the update is, {'key1': 'value A', 'k… Read more How To Update The Value Of A Key In A Json File Without Loading The Complete Json In Python?

Speedups In Looping Structures

I notice some interesting behavior when it comes to building lists in different ways. .append takes… Read more Speedups In Looping Structures

Aggregate Numpy Functions

I have a numpy operation that I call intensively and I need to optimise: np.sum(a**2, axis=1)**.5 … Read more Aggregate Numpy Functions

Python: Why Is List Comprehension Slower Than For Loop

Essentially these are the same functions - except list comprehension uses sum instead of x=0; x+= s… Read more Python: Why Is List Comprehension Slower Than For Loop

Caching A Generator

A recent similar question (isinstance(foo, types.GeneratorType) or inspect.isgenerator(foo)?) got m… Read more Caching A Generator

Why Is Python Faster Than C When Concatenating Two Strings?

Currently I want to compare the speed of Python and C when they're used to do string stuff. I t… Read more Why Is Python Faster Than C When Concatenating Two Strings?

Optimizing Strings In Cython

I'm trying to demonstrate to our group the virtues of Cython for enhancing Python performance. … Read more Optimizing Strings In Cython

Shelve Is Too Slow For Large Dictionaries, What Can I Do To Improve Performance?

I am storing a table using python and I need persistence. Essentially I am storing the table as a d… Read more Shelve Is Too Slow For Large Dictionaries, What Can I Do To Improve Performance?

Optimizing A Inequality Query In Ndb Over Two Properties

I'm trying to do a query into a range of valid dates q = Licence.query(Licence.valid_from = tod… Read more Optimizing A Inequality Query In Ndb Over Two Properties