-
Notifications
You must be signed in to change notification settings - Fork 11
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
perf: Decrease execution times by 1000% [DT-7499] #277
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…will clone the context
Change the name of the userContext function to make it clear that it will clone the context perf: Runs from ~14,000ms to ~4,000ms [DT-7499]
jocgir
force-pushed
the
feature/dt-7499-optimizeperf
branch
from
November 26, 2024 21:52
f06f9f7
to
2e83cc7
Compare
jocgir
reviewed
Nov 26, 2024
main.go
Outdated
@@ -22,6 +15,12 @@ import ( | |||
"github.com/coveooss/multilogger/errors" | |||
"github.com/fatih/color" | |||
"github.com/sirupsen/logrus" | |||
"os" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why moving the imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autoformatting
nicolegros
changed the title
perf: Runs from ~14,000ms to ~1,400ms [DT-7499]
perf: Decrease execution times by 1000% [DT-7499]
Nov 26, 2024
jocgir
force-pushed
the
feature/dt-7499-optimizeperf
branch
from
November 26, 2024 22:04
319d437
to
e611d9a
Compare
jocgir
approved these changes
Nov 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
main.go
andtemplate/extra_runtime.go
files to improve context handling and import organization. The most important changes include renaming a method for clarity, and optimizing template execution.Enhancements to template context handling:
template/extra_runtime.go
: Renamed theuserContext
method tocloneUserContext
to better reflect its functionality of cloning the user context.template/extra_runtime.go
: Refactored therunTemplate
method to use a newoptimizedRunTemplate
method, which includes an option to clone the context for template execution. This change ensures that templates can be executed with or without context cloning as needed. [1] [2] [3] [4]Testing updates:
template/extra_runtime_test.go
: Updated theTestRuntime
test case to reflect the changes in context handling, ensuring that the context is correctly managed and tested.