LiveScript icon indicating copy to clipboard operation
LiveScript copied to clipboard

Suggestion: check for too long ranges such as [0 to 55555]

Open viclib opened this issue 12 years ago • 5 comments

Some ranges like [0 to 55555] could be replaced with the runtime variant, instead of generating a giant array in code.

(Please keep in mind I'll make some suggestions with no priority at all, just trying to be helpful.)

viclib avatar Apr 27 '13 23:04 viclib

current limit seems to be 65536

vendethiel avatar May 01 '13 14:05 vendethiel

Hmm, I only got up to 30k ish.

apaleslimghost avatar May 01 '13 14:05 apaleslimghost

ah no, since we add 2 tokens each time, it's 65536/2 = 32768 (32767 works ok). so maybe we should lower it to ~5k maybe, after that it's just too slow. And just generate a runtime range.

vendethiel avatar May 01 '13 14:05 vendethiel

CoffeeScript has a limit of around 20 elements, after which it produces a runtime equivalent. So I think that lowering to 5000 elements is still not enough, the code of such arrays takes quite some space in a file.

pepkin88 avatar Aug 10 '18 14:08 pepkin88

And maybe produce a runtime equivalent for strings too, after a certain limit? [\가 to \힣] produces quite a large array, but I'll admit there are fewer use cases.

pepkin88 avatar Aug 10 '18 14:08 pepkin88