mde / true

A JavaScript port of the Unix utility 'true'. Returns the Boolean value `true`
101 stars 26 forks source link

improve performance #23

Open paul-hanneforth opened 3 years ago

paul-hanneforth commented 3 years ago

I think the current package became a little to slow. Especially since the caching was removed. Are there any suggestions on how to solve this problem? I was thinking maybe we could write a native c library and then import it to NodeJS if that's possible

mde commented 3 years ago

Native C would definitely be faster, except we know that in some cases, Chrome's function inlining results in execution times faster than C code. I'm not sure how big of a win this would be, but I'd be happy to take a look at a PR that implements this.

Miigon commented 3 years ago

Yeah, actually there is a cool new technology called WebAssembly now which isn't a thing yet at the release of this package. Anyone considering the possibility of optimizing the package with assembly code on platforms that supports it? Some benchmarking should be done beforehand, however, to make sure that such an optimization wouldn't make the package too fast to hit the state speed limit law of CA.

SpeedyCraftah commented 2 years ago

Is this going to be considered? I am running into performance issues with this package on Ubuntu running node 16.