Replies: 3 comments 2 replies
-
PR for this: #97 |
Beta Was this translation helpful? Give feedback.
-
Hey @nnmrts, thank you for your suggestion and PR! |
Beta Was this translation helpful? Give feedback.
-
Thanks, appreciate your answer! Really really sorry that I missed #30, usually I always search through the existing issues and PRs before creating one, somehow this time I forgot it. I appreciate the insight you gave about network requests and I admit I didn't even think about that. But I still think it's not that big of an issue. Here comes my attempt to convince you. It's quite long but please bear with me. Not really 12 most of the timesSo first of all, it would be very very uncommon for vr to make 12 requests. The way the loader currently is implemented, the number varies between 1 and 12, while 12 requests would be the "worst case" of having a config file named scripts.yaml
scripts.yml
scripts.json
scripts.ts
scripts.js
scripts.mjs
velociraptor.yaml
velociraptor.yml
velociraptor.json
velociraptor.ts
velociraptor.js
velociraptor.mjs So, as we can see, getting The currently supported file extensions could theoretically even be more prioritized by flipping the two loops, so it becomes: scripts.yaml
velociraptor.yaml
scripts.yml
velociraptor.yml
scripts.json
velociraptor.json
and so on... Getting 12 is not a lotSo this was just an assumption, but I really wanted to test it and so I did. First, local file reads, here's a table of the average of 1000 runs of an equivalent to
Two observations can be made here:
Now, let's take a look at the network side of things. This uses a naive rewrite using
Oof. Yeah, that's a lot compared to the local test. But if we actually use
There's practically no time difference between different options here. Yes, the And I don't think 25 ms is a lot. Sure, it always depends on your internet connection and a lot of other factors, but how long a single request takes isn't really the point here, right? The thing we try to find out here is: Adding extensions has little effectI wanted to test this directly and generally, so here we go. Let's use the function we used above, specify which extensions are allowed and compare different configurations of possible file extensions. These are the averages of 1000 local runs:
As we can see, there is indeed a difference between the current state
It already took some time to do these 100 runs per possible extensions configuration but it's quite obvious that 100 runs is not enough to get a good average. ConclusionI'm not a scientist and the methods described above are obviously not really scientific. However, I believe the results of my tests still point in a direction of "it doesn't really matter if we add I also realize there are some implementation specific flaws with my |
Beta Was this translation helpful? Give feedback.
-
I was quite surprised that vr only supports
.ts
after moving from a json config to a dynamic one. It should additionally support.js
and.mjs
, just like Deno does.I'll add a PR for this.
Beta Was this translation helpful? Give feedback.
All reactions