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

Webpage freezes when using hyper with larger values #33

Open
Acamaeda opened this issue May 21, 2021 · 1 comment
Open

Webpage freezes when using hyper with larger values #33

Acamaeda opened this issue May 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Acamaeda
Copy link

Using OmegaNum.hyper(900)(10, 10), for example freezes everything. It begins to take a noticeable amount of time around the 100th hyperoperator, and gets worse as it goes. You need to take some shortcuts to make this library actually function up to the 1000th hyperoperator, or at least put some warnings.

@Naruyoko Naruyoko added the enhancement New feature or request label Jun 20, 2021
@James103
Copy link

James103 commented Aug 8, 2022

Looks like OmegaNum.hyper(n)(10, 10) takes approximately O(n4) time, given the nth hyperoperator.
This is due in part to a bunch of nested while and for loops iterating over the entire array in the representation.
The function does eventually complete and return a valid answer though.

Data:

Hyperoperator	Time (ms)
10		0.40
20		0.95
30		2.02
40		4.49
50		8.86
60		16.21
70		27.70
80		43.12
90		65.69
100		95.98
125		227.9
150		441.4
175		781.7
200		1291.7
250		2998.2
300		6012
400		18052
500		43451

Experimental code:

var start_date = new Date().getTime();
console.log(OmegaNum.hyper(500)(10, 10)); // Replace '500' with the hyperoperator to test
return new OmegaNum(new Date().getTime() - start_date);

Note: Hyperoperators 10-100 were done with 100 samples each, 125-200 with 10 samples each, and 250 onward with 1 sample each.

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

No branches or pull requests

3 participants