Skip to content

Don't create a new ParserImpl on each parser() call#11255

Merged
normanmaurer merged 1 commit into4.1from
static_instance
May 14, 2021
Merged

Don't create a new ParserImpl on each parser() call#11255
normanmaurer merged 1 commit into4.1from
static_instance

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

Motivation:

ParserImpl is stateless and so we can use the same instance multiple times

Modifications:

  • Make constructor private
  • Return the same instance all the time

Result:

Less object creation

Motivation:

ParserImpl is stateless and so we can use the same instance multiple times

Modifications:

- Make constructor private
- Return the same instance all the time

Result:

Less object creation
@normanmaurer
Copy link
Copy Markdown
Member Author

/cc @violetagg

@normanmaurer normanmaurer added this to the 4.1.64.Final milestone May 14, 2021
@violetagg
Copy link
Copy Markdown
Member

thanks

@normanmaurer normanmaurer merged commit 78050c5 into 4.1 May 14, 2021
@normanmaurer normanmaurer deleted the static_instance branch May 14, 2021 13:19
normanmaurer added a commit that referenced this pull request May 14, 2021
Motivation:

ParserImpl is stateless and so we can use the same instance multiple times

Modifications:

- Make constructor private
- Return the same instance all the time

Result:

Less object creation
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
Motivation:

ParserImpl is stateless and so we can use the same instance multiple times

Modifications:

- Make constructor private
- Return the same instance all the time

Result:

Less object creation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants