Skip to content

ARROW-4461: [C++] Expose bit map operations that work with raw pointers#3560

Closed
emkornfield wants to merge 5 commits into
apache:masterfrom
emkornfield:bin_memory_allocs
Closed

ARROW-4461: [C++] Expose bit map operations that work with raw pointers#3560
emkornfield wants to merge 5 commits into
apache:masterfrom
emkornfield:bin_memory_allocs

Conversation

@emkornfield
Copy link
Copy Markdown
Contributor

Precursor to fixing the rest of the boolean computer kernels to not allocate memory.

Copy link
Copy Markdown
Contributor

@fsaintjacques fsaintjacques left a comment

Choose a reason for hiding this comment

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

Need a small fix in the documentation, the other comments/suggestions are optional and nitpicks.

Comment thread cpp/src/arrow/util/bit-util-test.cc Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While this is just a test, why not usememset?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, haven't cached memset into my working repertoire yet.

Comment thread cpp/src/arrow/util/bit-util.h Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

extra newline

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread cpp/src/arrow/util/bit-util.h Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This method does not allocate, documentation regarding out_buffer go on previous method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. fixed.

Comment thread cpp/src/arrow/util/bit-util.cc Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lots of duplication (2 functions for each operation), bonus point for a macro:

#define BITMAP_BINARY_IMPL ...

BITMAP_BINARY_IMPL(And, std::bit_and<uint8_t>, std::logical_and<bool>);
BITMAP_BINARY_IMPL(Or, std::bit_or<uint8_t>, std::logical_or<bool>);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you don't mind I'm going to leave as is MACROs are discouraged in the style guide and I'm on the fence if this is enough boiler to justify using them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Contributor Author

@emkornfield emkornfield left a comment

Choose a reason for hiding this comment

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

@fsaintjacques thanks for the review. I addressed the issues other then using the MACRO

Comment thread cpp/src/arrow/util/bit-util.cc Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you don't mind I'm going to leave as is MACROs are discouraged in the style guide and I'm on the fence if this is enough boiler to justify using them.

Comment thread cpp/src/arrow/util/bit-util.h Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread cpp/src/arrow/util/bit-util.h Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. fixed.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Feb 6, 2019

Codecov Report

Merging #3560 into master will increase coverage by 0.86%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3560      +/-   ##
==========================================
+ Coverage   87.76%   88.63%   +0.86%     
==========================================
  Files         673      544     -129     
  Lines       82763    73824    -8939     
  Branches     1069        0    -1069     
==========================================
- Hits        72640    65431    -7209     
+ Misses      10012     8393    -1619     
+ Partials      111        0     -111
Impacted Files Coverage Δ
cpp/src/arrow/util/bit-util.h 100% <ø> (ø) ⬆️
cpp/src/arrow/util/bit-util-test.cc 98.85% <100%> (+0.03%) ⬆️
cpp/src/arrow/util/bit-util.cc 96.87% <100%> (+0.23%) ⬆️
cpp/src/plasma/thirdparty/ae/ae.c 71.09% <0%> (-0.95%) ⬇️
go/arrow/math/uint64_amd64.go
go/arrow/memory/memory_avx2_amd64.go
js/src/enum.ts
go/arrow/array/builder.go
js/src/Arrow.node.ts
js/src/schema.ts
... and 123 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f13b70...08107f0. Read the comment docs.

@xhochy
Copy link
Copy Markdown
Member

xhochy commented Feb 8, 2019

Rebased

@emkornfield
Copy link
Copy Markdown
Contributor Author

@xhochy mind taking a look to see if this can be merged?

@wesm
Copy link
Copy Markdown
Member

wesm commented Feb 12, 2019

I'll take a look now

Copy link
Copy Markdown
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

+1

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.

5 participants