Skip to content

Speeding up with Numexpr #5

@wilko339

Description

@wilko339

Hi Pierre,

I love this generator, its working great for me! However, I would like to be able to use this to generate arrays with minimum of 300 elements in each dimension and it's quite slow at the moment. Have you ever heard of the Numexpr package? It's able to perform basic operations on large arrays much faster than NumPy. Maybe this would be able to reduce the time taken to run your generator?

For example, your 'f(t)' function (line5) could be written using Numexpr as follows:

import numexpr as ne

def f(t):
return ne.evaluate('6t**5 - 15t4 + 10*t3')

This will massively reduce the time. Just a suggestion for you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions