Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize Pipe performance #8

Merged
merged 5 commits into from
Jan 26, 2024
Merged

optimize Pipe performance #8

merged 5 commits into from
Jan 26, 2024

Conversation

trvswgnr
Copy link
Owner

@trvswgnr trvswgnr commented Jan 26, 2024

I've implemented several optimizations and improvements in the pipe.ts file, focusing on enhancing performance and maintaining code clarity. These changes are part of our continuous effort to improve efficiency and maintainability of our codebase.

馃幆 Changes

  • Performance Optimization in Pipe: Refactored the Pipe function to streamline object properties, removing unnecessary method calls and simplifying the return type cast (8e104d4).
  • Performance Regression Checks: Updated pipe.bench.ts to include checks for performance regressions, ensuring that enhancements do not inadvertently impact performance negatively (f4b92e4).
  • Worker Threads in Benchmarks: Introduced the use of worker threads in pipe.bench.ts for better management of cancel and cleanup processes, aiming for more accurate performance measurements (8a50bc6).
  • Testing for Performance Regression: Added a new test in pipe.test.ts specifically to detect performance regressions, as part of our commitment to maintain high performance standards (ab494d6).
  • Benchmarking Script Addition: Added a "bench" script to package.json to facilitate easier and more consistent benchmarking during development (5b62060).

馃殌 Benefits

  • Efficiency: The optimizations lead to reduced overhead and improved execution speed.
  • Code Clarity: Streamlining object properties enhances readability and maintainability.
  • Reliability: Integration of performance regression checks and tests ensures that enhancements do not slow down the Pipe.
Benchmark Results

鈿狅笍 Considerations

  • The performance tests and benchmarks should be run to verify the improvements in different environments.
  • Further refactoring might be required in future updates for continued optimization.

idk if this will be accurate enough to keep around
if it causes problems we'll ditch it
refines the `pipe` function in `pipe.ts` to enhance performance
- removed unnecessary `defineprivateproperties` calls to simplify object structure.
- simplified return statement by directly casting to `Pipeable<t>`

the goal is to reduce overhead and clarify structure

tests were also slightly modified to accomodate
@trvswgnr trvswgnr added the enhancement New feature or request label Jan 26, 2024
@trvswgnr trvswgnr merged commit 9e3a8c9 into main Jan 26, 2024
2 checks passed
@trvswgnr trvswgnr deleted the performance-optimizations branch January 26, 2024 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant