Skip to content

Evaluate and improve the transformation performance of On Demand Feature View #4207

Closed

Description

@shuchu

Expected Behavior

The On Demand Feature View has implementations with using Python native object and Pandas object as the input/output.

We want to evaluate the performance in terms of time. Moreover, we want to understand the bottleneck of the performance in code running efficiency level.

Current Behavior

Steps to reproduce

Specifications

  • Version: 0.37.1
  • Platform: Linux/Ubuntu
  • Subsystem:

Possible Solution

use cProfile and existing unit test functions.

Activity

  1. self-assigned this
    on May 17, 2024
  2. shuchu commented on May 19, 2024

    @shuchu
    CollaboratorAuthor

    An easy run shows the performance of Pandas is really bad comparing to Python native objects.

    Screenshot 2024-05-18 231742
    Screenshot 2024-05-18 231751

  3. franciscojavierarceo commented on Jun 6, 2024

    @franciscojavierarceo
    Member

    Example code of cProfile with snakeviz.

    import cProfile
    
    from scipy.optimize import minimize
    
    
    def main():
        # c.f. https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html
        func = lambda x: (x[0] - 1) ** 2 + (x[1] - 2.5) ** 2
        x0 = (2, 0)
    
        constraints = (
            {"type": "ineq", "fun": lambda x: x[0] - 2 * x[1] + 2},
            {"type": "ineq", "fun": lambda x: -x[0] - 2 * x[1] + 6},
            {"type": "ineq", "fun": lambda x: -x[0] + 2 * x[1] + 2},
        )
    
        bounds = ((0, None), (0, None))
    
        result = minimize(func, x0, method="SLSQP", bounds=bounds, constraints=constraints)
        print(f"result:\n{result}")
        print(f"best fit parameters: {result.x}")
    
    
    if __name__ == "__main__":
        profiler = cProfile.Profile()
        profiler.enable()
        main()
        profiler.disable()
        profiler.dump_stats("example.prof")
  4. franciscojavierarceo commented on Jun 8, 2024

    @franciscojavierarceo
    Member

    Done here: franciscojavierarceo/Python#23

    Pandas

    image

    Python

    image

    Comparison

    Local performance
    Pandas runtime = 8.65ms
    Python runtime = 0.907ms

    Nearly 10x reduction in processing time.

  5. haoxu0 commented on Nov 21, 2024

    @haoxu0
    Collaborator

    Done here: franciscojavierarceo/Python#23

    Pandas

    image

    Python

    image

    Comparison

    Local performance Pandas runtime = 8.65ms Python runtime = 0.907ms

    Nearly 10x reduction in processing time.

    really cool.
    Is the unit right? ~1ms or ~10ms is super fast :)

  6. changed the title [-]Evaluate and improve the WRITE performance of On Demand Feature View[/-] [+]Evaluate and improve the transformation performance of On Demand Feature View[/+] on Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions