Open kalawr opened 5 years ago
Hello @kalawr! That's great to hear that you're enjoying the library!
I haven't ever run elm-typescript-interop
on a project large enough to cause performance issues. I appreciate you reporting the slow performance.
So I've got a few thoughts to explore on how to improve performance here:
elm-ast
libraries support Elm 0.19 (and it's possible that they won't be upgraded). I'm going to explore using https://github.com/stil4m/elm-syntax. If this works, then it would allow me to upgrade to 0.19 finally, which may improve performanceMain
modules to use, but this could improve performance. Judging by your particular project, does this seem like it could be a promising path? In other words, about what percentage of files (or lines of code) would need to be parsed if we only parsed modules which are import
ed from the Main module you are generating a TypeScript definition for (roughly)?Before exploring any of these, it would be really helpful to get some metrics from you so I can understand the problem better.
To start, could you provide me with the following:
cloc
)elm-typescript-interop
(you can just use time
on Unix)sysconfcpus -n 1
, does the time
change?Thank you!
Dillon
Specs: Windows 10, 64-bit; 20 Gb RAM; Intel i7-5600U 2.60 Hz
LOC: The project contains 23,251 lines of Elm code (as per cloc
). For this particular project we are using Prisma and elm-graphql
, which results in a considerable amount (18,081 lines) of auto-generated Elm files. My estimate would be around 15% of all files are not linked to the app import tree.
Time: elm-typescript-interop
ran for 889.623 s
(~15 minutes, benchmarked with ptime) before it exited with an error:
Alias `ValueId` not found. Known aliases:
Api.InputObject.CompanyCreateOneWithoutHierarchiesInputOptionalFields...
However, the project compiles with elm make
.
Can't run sysconfcpus -n 1
on Windows, sorry. Should I try to look for a workaround?
We can give you access to the project repo, if it works for you! Really thankful for your time and willingness to help us out.
Hi Dillon! Thanks for your great work, we are loving the library! We tried applying the
elm-typescript-interop
to our project (about 21,000 LOC of Elm), which coincidentally useselm-graphql
too, and the time it takes to parse all of these files and produce the output is way beyond practical. Have you run into performance issues yourself withelm-typescript-interop
or heard similar stories? Would love to help you get to the bottom of this and contribute. Thanks!