-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate degradation of performance for medium-size codebase (5~10 kLoc) #1622
Comments
UpdateThe flamegraph isn't very informative, without one big obvious contention point: @vkleen's plan is to start adding tracing to various part of the Nickel interpreter to gather finer stats and timing for those kind of use-cases. In the meantime, I noticed that:
|
Some news: I got rid of closurization (or at least of generated variables) on a branch, which was a non trivial changes. It got rid of almost 1M environment oeprations (insertion and fetch). But much to my surprise, this wasn't the dominant cost, and this didn't win much. Some metrics:
We won 1M environment operations, but the order of magnitude didn't change. And it's still huge. I started to gathered way much more metrics, number of execution per primitive operations and per contract applications, typically (the data are verbose and raw, so I joined the file. We are applying 1.3M contracts (!) and, it seems, a lot of array contracts - and in particular polymorphic contracts. Which is a bit of a shame, given that for example the map function's contract The next step I did was thus to implement a form of contract simplification for static type annotations, to get constant-time behavior as much as possible. This resulted in another 50% win: we're not back under the seconds, but still back under 4sec, which is not bad. Will set up the corresponding PR soon, and continue from there to understand why we still have so many contracts being applied. |
@yannham is this done, as due date is passed ? |
While it's not back "under a second", it's consistently back around 3seconds after several optimizations. This is not the end of the story, but work coming next can be done as part of a new tracking issue/epic, I think. We did investigate and applied somehow successfully the first train of optimizations. |
Describe the bug
While I can't produce the code here for privacy reason, I've been personally given a Nickel codebase where the export time is very long (for 5~10kLoC, between 10 and 20s on my laptop). There is no reason that a program of this size is that slow. The code looks rather reasonable, and it means that we are at risk of similar performance degradation for any codebase that reaches this size.
Let's investigate, profile and rely on #1484 to see what's happening and bring that time down to something reasonable.
To Reproduce
Can't share the offending code here for privacy reason, unfortunately.
Expected behavior
That the export time is low (as a starter, say under a second).
Tasks
The text was updated successfully, but these errors were encountered: