syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Experimental: turn most of printer's lists into arrays

Open chenglou opened this issue 4 years ago • 1 comments

Excuse the commit messages. Just a toy.

This tries to allocate as few lists as possible.

Benchmark shows that everything allocates less (kinda obvious if you think about it), but the perf isn't necessarily better for now, mostly because the printer algorithm uses little pieces of lists (now arrays) again and again. So the saving of array isn't that big.

However, if/when we convert more things to array, like comments, maybe this'll shine more.

chenglou avatar Mar 05 '21 00:03 chenglou

Before: Screen Shot 2021-03-04 at 4 42 44 PM

After: Screen Shot 2021-03-04 at 4 40 04 PM image

chenglou avatar Mar 05 '21 00:03 chenglou

The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

stale[bot] avatar May 28 '23 08:05 stale[bot]