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

[fix](HadoopLz4BlockCompression)Fixed the bug that HadoopLz4BlockCompression creates _decompressor every time it decompresses. #37187

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

hubgeter
Copy link
Contributor

@hubgeter hubgeter commented Jul 2, 2024

Proposed changes

Problem:
HadoopLz4BlockCompression uses a singleton mode.
Every time its decompression function is called, a new object will be created for its member variable _decompressor. In a multi-threaded scenario, new objects will be created for _decompressor at the same time.

Fix method:
During the construction phase of HadoopLz4BlockCompression, a new object is created for its member variable _decompressor. When calling the decompression function, there is no need to create a new object for _decompressor.

Issue Number: close #xxx

…ression creates _decompressor every time it decompresses.
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@hubgeter
Copy link
Contributor Author

hubgeter commented Jul 2, 2024

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -25,6 +25,8 @@
defined(__i386) || defined(_M_IX86)
#include <libdeflate.h>
#endif
#include <glog/log_severity.h>
#include <glog/logging.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: duplicate include [readability-duplicate-include]

be/src/util/block_compression.cpp:27:

- #include <glog/log_severity.h>
- #include <glog/logging.h>
+ #include <glog/log_severity.h>

@doris-robot
Copy link

TPC-H: Total hot run time: 40690 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 096d34bee65ede4731de59c3676f95281892d18e, data reload: false

------ Round 1 ----------------------------------
q1	17969	4448	4373	4373
q2	2465	197	192	192
q3	11832	1178	1214	1178
q4	10227	770	749	749
q5	7890	2677	2619	2619
q6	225	144	143	143
q7	970	620	629	620
q8	9295	2069	2064	2064
q9	8870	6501	6516	6501
q10	9002	3694	3725	3694
q11	458	246	244	244
q12	469	237	233	233
q13	17760	3040	3039	3039
q14	287	228	231	228
q15	527	496	479	479
q16	534	382	389	382
q17	965	623	647	623
q18	7969	7541	7408	7408
q19	6875	1503	1419	1419
q20	672	329	336	329
q21	4890	4031	3827	3827
q22	400	346	355	346
Total cold run time: 120551 ms
Total hot run time: 40690 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4416	4255	4250	4250
q2	395	267	280	267
q3	2965	2728	2681	2681
q4	1869	1554	1618	1554
q5	5244	5275	5290	5275
q6	223	133	134	133
q7	2149	1795	1714	1714
q8	3182	3322	3329	3322
q9	8392	8298	8372	8298
q10	3881	3639	3649	3639
q11	579	493	491	491
q12	804	572	571	571
q13	17391	3017	2995	2995
q14	294	265	271	265
q15	527	485	472	472
q16	467	418	442	418
q17	1793	1514	1451	1451
q18	7711	7440	7414	7414
q19	1722	1600	1525	1525
q20	2032	1811	1782	1782
q21	4944	4818	4842	4818
q22	619	567	560	560
Total cold run time: 71599 ms
Total hot run time: 53895 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174715 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 096d34bee65ede4731de59c3676f95281892d18e, data reload: false

query1	924	379	370	370
query2	6446	2562	2537	2537
query3	6654	203	210	203
query4	18779	17587	17418	17418
query5	4214	498	501	498
query6	281	216	172	172
query7	4607	301	300	300
query8	326	312	291	291
query9	8422	2391	2379	2379
query10	632	306	317	306
query11	10407	9833	10132	9833
query12	130	93	84	84
query13	1634	372	383	372
query14	10346	7862	7739	7739
query15	245	187	182	182
query16	7817	269	263	263
query17	1905	532	536	532
query18	1834	276	295	276
query19	203	170	168	168
query20	93	88	82	82
query21	209	141	125	125
query22	4352	4075	4229	4075
query23	33862	33222	33143	33143
query24	11044	2814	2804	2804
query25	639	374	367	367
query26	1393	154	154	154
query27	2939	314	316	314
query28	7513	2077	2070	2070
query29	940	634	637	634
query30	270	158	159	158
query31	970	744	759	744
query32	97	57	57	57
query33	799	319	331	319
query34	907	483	508	483
query35	751	661	636	636
query36	1106	967	940	940
query37	156	77	126	77
query38	2852	2725	2743	2725
query39	851	793	788	788
query40	227	129	131	129
query41	54	55	54	54
query42	136	106	102	102
query43	624	531	549	531
query44	1266	745	771	745
query45	196	163	161	161
query46	1082	709	734	709
query47	1838	1766	1776	1766
query48	392	307	299	299
query49	1086	427	419	419
query50	779	396	392	392
query51	6932	6765	6820	6765
query52	102	100	98	98
query53	363	291	295	291
query54	953	459	451	451
query55	76	73	78	73
query56	296	306	281	281
query57	1128	1048	1034	1034
query58	251	257	273	257
query59	3566	3682	3287	3287
query60	319	282	291	282
query61	97	95	97	95
query62	653	448	441	441
query63	323	295	299	295
query64	9225	2290	1772	1772
query65	3159	3121	3074	3074
query66	1004	334	338	334
query67	15588	15034	14901	14901
query68	5365	562	555	555
query69	618	448	336	336
query70	1215	1143	1144	1143
query71	451	287	291	287
query72	7300	5608	5810	5608
query73	772	330	329	329
query74	5958	5553	5391	5391
query75	3763	2640	2684	2640
query76	3368	946	1002	946
query77	685	306	309	306
query78	10290	9746	9740	9740
query79	2335	523	532	523
query80	1499	498	484	484
query81	527	224	225	224
query82	473	108	108	108
query83	198	172	171	171
query84	269	87	92	87
query85	1142	299	282	282
query86	367	333	321	321
query87	3269	3056	3110	3056
query88	3617	2438	2433	2433
query89	494	389	396	389
query90	1916	190	191	190
query91	130	103	104	103
query92	65	51	53	51
query93	4164	530	531	530
query94	1277	187	190	187
query95	410	324	319	319
query96	604	327	264	264
query97	3192	3036	3029	3029
query98	224	203	196	196
query99	1185	831	831	831
Total cold run time: 276406 ms
Total hot run time: 174715 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.42 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 096d34bee65ede4731de59c3676f95281892d18e, data reload: false

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.06
query4	1.67	0.08	0.09
query5	0.50	0.48	0.47
query6	1.13	0.73	0.72
query7	0.02	0.02	0.02
query8	0.05	0.05	0.04
query9	0.54	0.48	0.49
query10	0.54	0.54	0.56
query11	0.16	0.11	0.11
query12	0.14	0.12	0.12
query13	0.59	0.58	0.58
query14	0.77	0.78	0.77
query15	0.84	0.82	0.82
query16	0.36	0.35	0.37
query17	1.02	0.97	1.02
query18	0.23	0.24	0.24
query19	1.75	1.71	1.73
query20	0.01	0.02	0.01
query21	15.45	0.74	0.65
query22	3.77	7.65	1.82
query23	18.22	1.50	1.27
query24	2.05	0.22	0.22
query25	0.15	0.09	0.08
query26	0.26	0.17	0.16
query27	0.09	0.08	0.08
query28	13.35	1.02	1.01
query29	12.61	3.27	3.28
query30	0.27	0.07	0.05
query31	2.85	0.40	0.39
query32	3.29	0.47	0.47
query33	2.87	2.99	2.86
query34	17.14	4.43	4.48
query35	4.50	4.46	4.50
query36	0.65	0.46	0.48
query37	0.19	0.16	0.16
query38	0.15	0.14	0.16
query39	0.04	0.04	0.03
query40	0.18	0.14	0.13
query41	0.09	0.06	0.05
query42	0.05	0.04	0.05
query43	0.04	0.04	0.04
Total cold run time: 108.93 s
Total hot run time: 30.42 s

@hubgeter
Copy link
Contributor Author

hubgeter commented Jul 3, 2024

run p0

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

PR approved by at least one committer and no changes requested.

Copy link
Contributor

github-actions bot commented Jul 4, 2024

PR approved by anyone and no changes requested.

@morningman morningman merged commit ac17cfa into apache:master Jul 4, 2024
27 of 31 checks passed
morningman pushed a commit that referenced this pull request Jul 4, 2024
…ression creates _decompressor every time it decompresses.(#37187) (#37299)

bp : #37187
dataroaring pushed a commit that referenced this pull request Jul 17, 2024
…ression creates _decompressor every time it decompresses. (#37187)

## Proposed changes

Problem:
HadoopLz4BlockCompression uses a singleton mode.
Every time its decompression function is called, a new object will be
created for its member variable _decompressor. In a multi-threaded
scenario, new objects will be created for _decompressor at the same
time.

Fix method:
During the construction phase of HadoopLz4BlockCompression, a new object
is created for its member variable _decompressor. When calling the
decompression function, there is no need to create a new object for
_decompressor.
@yiguolei yiguolei mentioned this pull request Jul 19, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/2.1.5-merged dev/3.0.1-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants