Amogh Margoor has posted comments on this change. ( http://gerrit.cloudera.org:8080/17860 )
Change subject: IMPALA-9873: Avoid materilization of columns for filtered out rows in Parquet table. ...................................................................... Patch Set 8: (1 comment) http://gerrit.cloudera.org:8080/#/c/17860/8/be/src/exec/scratch-tuple-batch.h File be/src/exec/scratch-tuple-batch.h: http://gerrit.cloudera.org:8080/#/c/17860/8/be/src/exec/scratch-tuple-batch.h@74 PS8, Line 74: boost::scoped_array<bool> selected_rows; > I wonder if using vector<bool> would be better since it's uses a space-effi So I had thought about using std::bitset, vector<bool> and current boolean array. bitset needs length at compile time so I discarded it. Based on this stack overflow discussion, I had decided to use vector<bool> itself: https://stackoverflow.com/a/36933356/17210459. But when I remeasured the same Prime function code in answer and another benchmark I created to mimick simple pattern that we use I found boolean array to be faster on gcc 7.5 on CPU times. Benchmarks: https://quick-bench.com/q/ejXNWbgFJlDqC0jsHCieLTr_aK0 https://quick-bench.com/q/EJsSeRrjbqU1eXsOH2ySLtWdR1M I agree vector<bool> is more space efficient but I think bit manipulation to set and read values might be consuming more time. I was hoping in second benchmark vector<bool> may be faster as it may fit within cacheline but even there it was 1.3 times slower. -- To view, visit http://gerrit.cloudera.org:8080/17860 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I46406c913297d5bbbec3ccae62a83bb214ed2c60 Gerrit-Change-Number: 17860 Gerrit-PatchSet: 8 Gerrit-Owner: Amogh Margoor <[email protected]> Gerrit-Reviewer: Amogh Margoor <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Kurt Deschler <[email protected]> Gerrit-Reviewer: Qifan Chen <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]> Gerrit-Comment-Date: Thu, 21 Oct 2021 11:21:30 +0000 Gerrit-HasComments: Yes
