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 field duplication on insertion #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

charlesbr1
Copy link
Contributor

All the inserted fields are duplicated : they are converted to StringField, then added to the treeMap.
We can remove a lot of allocations by avoiding this behavior. Unless there is a specific reason for this purpose, it seems to works fine without this.

The setField(DoubleField field) method got a different implementation from the other because we do not want to allocate a Double instance if the field was built using a double. Hence no null field check are performed for this one.

Furthermore, the setGroupCount() method allocated the string "1" when there is only one group, this is not efficient.

A cache for frequently used string of integers
All the inserted fields are duplicated : they are converted to StringField, then added to the treeMap.
We can remove a lot of allocations by avoiding this behavior. Unless there is a specific reason for this purpose, it seems to works fine without this.
Furthermore, the setGroupCount() method allocated the string "1" when there is only one group, this is not efficient.
Fixed a regression (ClassCastException) with components
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.

None yet

1 participant