Lift literal expressions to top-level constants in JavaScript code generation
#4,090 opened on Dec 17, 2024
Repository metrics
- Stars
- (21,417 stars)
- PR merge metrics
- (Avg merge 10d 19h) (69 merged PRs in 30d)
Description
- make a massive list in gleam
you can use gleam csv package to turn a csv file to gleam list then do io.debug(parssed_csv)
-
make the list be
let list = [ // here will be the long list ] -
do some computation to the data for me it was getting a specific element from the list
-
change the list from
let list =toconst list
(make sure its a process that would take 1 or more seconds so you can notice the difference visually)
i noticed this in a lustre application i needed to get the element number 34 from list number 77 this took 4 seconds just by changing the list to const it was instant
( the version this happened on was 1.5 iirc it good to test if it still happens now )