Skip to content
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

Remove @metadata_list from buffer.rb #2563

Merged
merged 6 commits into from
Aug 16, 2019

Conversation

ganmacs
Copy link
Member

@ganmacs ganmacs commented Aug 15, 2019

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:

I removed @metada_list from buffer.rb since this ivar has almost no meaning. Moreover, this is an overhead since Buffer#add_metadata is called many times.

Docs Changes:

no need

Release Note:

same as title

it is not used and a bit large overhead for performance.

Signed-off-by: Yuta Iwama <[email protected]>
@ganmacs ganmacs added the enhancement Feature request or improve operations label Aug 15, 2019
@repeatedly
Copy link
Member

I noticed metadata calls new_metadata but calling keyword argument function is slow.
How abut creating Metadata directly instead of new_metadata?

meta = new_metadata(timekey: timekey, tag: tag, variables: variables)

end
log.trace "chunk purged", instance: self.object_id, chunk_id: dump_unique_id_hex(chunk_id), metadata: metadata
end

if metadata && metadata.timekey
@mutex.synchronize { del_timekey(metadata.timekey) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mutex.synchronize is called in del_timekey

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot about it! thanks.
.5c81b40

@ganmacs ganmacs marked this pull request as ready for review August 16, 2019 06:55
@ganmacs ganmacs self-assigned this Aug 16, 2019
@repeatedly repeatedly merged commit d3c8766 into fluent:master Aug 16, 2019
@repeatedly
Copy link
Member

Looks good.

@ganmacs ganmacs deleted the remove-unused-data branch November 28, 2019 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants