Skip to main content

New answers tagged

0 votes

could functions compress() / compress2() from zlib be parallelized without breaking serial inflate()

What you want to do is likely handle the adler32 checksum yourself. There are functions to join the checksum if you have the checksum + length. You should first write the ZLIB header bytes, then use ...
some1and2's user avatar
  • 179
0 votes

Dask client connects successfully but no workers are available

Issue solved Turns out the server I was working on has some issue connecting to Dask. :") Thanks!
martian muonhunter's user avatar
0 votes

How to limit the maximum number of parallel tasks in C#

Use Polly Rate Limiter, with Concurrency Limiter configuration you can create separate thread pools per use case you can add new tasks into the pool at runtime, during execution, not just at pool ...
Tomasz Modelski's user avatar
Best practices
0 votes
0 replies
0 views

How to add many fractions together as fast as possible?

If you have an nvidia gpu use jit and cuda for max parallelization. These can be installed using numba and the cudatoolkit. Dont use the fraction.fraction class and just store all of your fractions in ...
Lagor845's user avatar
Best practices
1 vote
0 replies
0 views

How to add many fractions together as fast as possible?

You might also be interested in module quicktions. From what I understand, it's a faster module made by one of the contributors to the standard fractions module. It uses Cython and tries to avoid all ...
Stef's user avatar
  • 15.7k
Best practices
2 votes
0 replies
0 views

How to add many fractions together as fast as possible?

Instead of computing the gcd at every iteration, maybe you could compute the lcm of all the denominators directly in a first pass, then write all fractions with that denominator, then add them.
Stef's user avatar
  • 15.7k
Best practices
1 vote
0 replies
0 views

How to add many fractions together as fast as possible?

Python function calls and object creation are slow. As in, really slow. The fractions module may be really well-written, but any code that creates many Fraction objects, then combine them together ...
Stef's user avatar
  • 15.7k
Best practices
1 vote
0 replies
0 views

How to add many fractions together as fast as possible?

The basic idea of combining them in pairs should be simple enough to get right. Do it in scalar form first to obtain a prototype. You might also want to presort them by denominator value before ...
Martin Brown's user avatar
  • 3,895
Best practices
0 votes
0 replies
0 views

How to add many fractions together as fast as possible?

That number of decimal digits is about enough to express the diameter of the Solar system with 1 mm precision. Perhaps you are trying to solve a wrong problem? Just wondering. Anyway, you get ...
n. m. could be an AI's user avatar
Best practices
2 votes
0 replies
0 views

How to add many fractions together as fast as possible?

For parallel processing, the first questions is whether you are cpu bound or not. Given that this is all pure cpu steps; you are probably looking at multiprocessing instead of threading. However, with ...
Jason Chia's user avatar
  • 1,175

Top 50 recent answers are included