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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existential crisis with collections.ts #83161

Open
jlsnow301 opened this issue May 9, 2024 · 3 comments
Open

Existential crisis with collections.ts #83161

jlsnow301 opened this issue May 9, 2024 · 3 comments
Labels
UI We make the game less playable, but with round edges

Comments

@jlsnow301
Copy link
Contributor

jlsnow301 commented May 9, 2024

Issue Summary

These helpers are offered as faster alternatives. They are not. Here are some of my benchmarks, done in the byond browser using webpack, swc, esbuild just like our current setup.

expand Details: array of 10000 containing 1, 2, 3, ...

Custom filter execution time: 0.3000000000000007
Built-in filter execution time: 0.09999999999999964

Custom filter execution time: 0.29999999999999893
Built-in filter execution time: 0.10000000000000142

Custom filter execution time: 1.5999999999999996
Built-in filter execution time: 0.6999999999999993

Custom map execution time: 0.29999999999999893
Built-in map execution time: 0.20000000000000106

Custom map execution time: 0.5999999999999996
Built-in map execution time: 0.20000000000000106

Custom reduce execution time: 0.29999999999999893
Built-in reduce execution time: 0.20000000000000106

Custom reduce execution time: 0.3000000000000007
Built-in reduce execution time: 0.09999999999999964

Custom reduce execution time: 0.1999999999999993
Built-in reduce execution time: 0.10000000000000053

Custom sortBy execution time: 2.8000000000000007
Built-in sort execution time: 0.7999999999999972

Custom sortBy execution time: 2.799999999999999
Built-in sort execution time: 0.9000000000000003

Custom sortBy execution time: 2.7
Built-in sort execution time: 0.9000000000000003

I dislike having another version of the standard lib offered alongside because needless difference creates needless confusion. I propose removing them.

Reproduction:

I made a repo, just clone it and follow instructions:
https://github.com/jlsnow301/react-swc-webpack

@jlsnow301 jlsnow301 added the UI We make the game less playable, but with round edges label May 9, 2024
@MrStonedOne
Copy link
Member

Do you have a copy of the 516 alpha?

running these on edge/webkit might expose the speedups they were claiming existed.

@jlsnow301
Copy link
Contributor Author

Do you have a copy of the 516 alpha?

running these on edge/webkit might expose the speedups they were claiming existed.

I do, I'll give them a shot there.

I expect the leap from ie11 -> blink123 to be so monumental that the speed difference will be unnoticeable / unnecessary

@jlsnow301
Copy link
Contributor Author

Reposting 516 results because I posted them on discord. The results of each custom function are fairly equal to their built in counterparts in edge/blink 123/byond 516. The only stand out is sortBy, which still gets stomped:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI We make the game less playable, but with round edges
Projects
None yet
Development

No branches or pull requests

2 participants