CodyC
Typescript monorepo LSP performance
FWIW, there are reports of LSP performance fixes in the latest deno release (v2.1.8). See if that improves things for you?
https://www.reddit.com/r/Deno/comments/1idwroh/deno_218_is_out/
11 replies
Super slow LSP with Deno + VSCode
FWIW, there are reports of LSP performance fixes in the latest deno release (v2.1.8). See if that improves things for you?
https://www.reddit.com/r/Deno/comments/1idwroh/deno_218_is_out/
6 replies
batching tasks
I wrote a library to do this kind of thing because I wasn't a fan of the ones I found.
https://jsr.io/@nfnitloop/better-iterators
https://jsr.io/@nfnitloop/better-iterators
12 replies
Typescript monorepo LSP performance
The deno team does seem to be interested in a performant language server, btw. They even made a post about it a while back:
Recently, a customer reported significant performance issues with our language server in large codebases. Their feedback led us to investigate and optimize our language server, resulting in a dramatic reduction in auto-completion times - from 8 seconds to under one second. This blog post details how we achieved this improvement, from identifying the problem to implementing the solution.https://deno.com/blog/optimizing-our-lsp
11 replies
Reliable pattern for cleaning up resources as process exists?
I'd settle for something that let me register (and later remove) a "cleanup" callback that would have a chance to run as the process is exiting from a signal, an .exit(), unhandled rejection, etc. (so I don't need to track down all the cases, which may change in the future)
5 replies
Typescript monorepo LSP performance
I believe the Deno team uses a monorepo for the std libraries. (https://jsr.io/@std), but that might be a smaller codebase than yours. If you don't get a response here in the next day or two, I'd suggest opening an issue on the Deno GitHub. They might also be able to provide more tips, or info on how to help track down the performance bottleneck.
11 replies
Typescript monorepo LSP performance
The next thing I'd check for is any
node_modules
folders left over from the conversion from npm packages. (I'd hope not, but,) The language server might be trying to parse all of that code as part of your project. And node_modules directories can get quite large.11 replies
Reliable pattern for cleaning up resources as process exists?
In other languages, the process shutting down can result in exceptions being thrown, which lets the usual code pathways (
finally
blocks) clean up resources. I'm thinking, KeyboardInterrupt in Python, or InterruptedException in Java.
But, I don't know if JS/V8 has anything like that. You'd need to be able to just throw some exception at any trivial point in code.5 replies
Typescript monorepo LSP performance
deno just makes one typescript projectThat would be my guess too... ... unless you've configured your monorepo as a workspace. Have you done that? Or is it just a big repo with N unrelated codebases in it? https://docs.deno.com/runtime/fundamentals/workspaces/
11 replies
Reliable pattern for cleaning up resources as process exists?
I hacked together a thing that does this in my critical path, at least:
* Register signal handlers for SIGTERM and SIGINT (others I should add?)
* The handler sets an "aborted" flag.
* Periodically check that flag in my code (it's mostly a loop) and throw an exception if we aborted.
* Unregister the event handlers at the end of my scope.
... but this only works for my example because I know my exception will bubble all the way up out of
main()
, so I don't lose the default ctrl-c
behavior of killing the app. Doing this in a library would be bad news because the user might be trying to SIGINT (ctrl-c) to quit the program but some higher-level handling is catching the exception.5 replies
Sharing a library between deno and frontend
I'm interested to hear what other responses you get here. I've been sortof cobbling my own system together.
I'm using Preact for server-side rendering for most of a project I'm working on, but then I want to be able to re-use some components for the parts that do need to be interactive client-side. (Take a look at the Fresh framework, which does a lot of this for you quite easily. I'm just being pedantic in my use case.)
I wrote my own little tool, https://github.com/NfNitLoop/deno-embedder which can also run ESBuild to transpile typescript/TSX for use on the web. So now it's easy for me to use a component on the server or in the client.
3 replies