jmeaster30 / ocean

A C-like programming language (get it like sea-like like an ocean lol)
GNU General Public License v3.0
0 stars 0 forks source link

Optimize compile times #93

Closed jmeaster30 closed 8 months ago

jmeaster30 commented 8 months ago

Some of my really basic examples takes 130ms to compile which is pretty rough but we are also doing things extremely inefficiently.

Need to research how to optimize rust/even take profiles cause I am a huge rust noob.

jmeaster30 commented 8 months ago

We copy modules a ridiculous amount to step around the borrow checker. My guess is it is something with that but again I am not sure at all

jmeaster30 commented 8 months ago

We don't do any parallelism and we don't do any analysis so the performance is pretty sad

jmeaster30 commented 8 months ago

Okay I ran some profiling and I used regex in the parser out of laziness and we built 4 regexes for each token that was generated.

examples/hydro/arrays.h2o with regexes - 156.144582 ms (54 lines across 2 files) examples/hydro/arrays.h2o without regexes - 383 us (54 lines across 2 files)

This is like a 400x speed up lmao

jmeaster30 commented 8 months ago

weirdly regex calls still show up in the profile but I don't know where it is coming from. We could maybe go even faster

jmeaster30 commented 8 months ago

There are way more optimizations we could do but this will be an on-going thing instead of one issue