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

POC zero left padding for PODArray #3920

Merged
merged 4 commits into from
Dec 25, 2018

Conversation

amosbird
Copy link
Collaborator

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

  • Performance Improvement

Short description (up to few sentences):

Zero left padding PODArray so that -1 element is always valid and zeroed. It's used for branchless Offset access.

simple tests show 1%-5% improvements

Before padding

Running: left pad test
[
{
    "hostname": "201.nobida.cn",
    "main_metric": "min_time",
    "num_cores": 20,
    "num_threads": 40,
    "ram": 134768111616,
    "runs": [
        {
            "min_time": 0.086000,
            "query": "SELECT max(length(MobilePhoneModel)) FROM hashfile"
        },
        {
            "min_time": 0.102000,
            "query": "SELECT max(length(Params)) FROM hashfile"
        },
        {
            "min_time": 0.441000,
            "query": "SELECT max(length(Title)) FROM hashfile"
        },
        {
            "min_time": 0.143000,
            "query": "SELECT max(length(URLDomain)) FROM hashfile"
        },
        {
            "min_time": 0.120000,
            "query": "SELECT max(length(PageCharset)) FROM hashfile"
        },
        {
            "min_time": 0.429000,
            "query": "SELECT max(length(Referer)) FROM hashfile"
        },
        {
            "min_time": 0.504000,
            "query": "SELECT max(length(URL)) FROM hashfile"
        },
        {
            "min_time": 0.075000,
            "query": "SELECT max(length(UTMSource)) FROM hashfile"
        }
    ],
    "server_version": "18.16.0",
    "test_name": "left pad test",
    "time": "2018-12-24 22:45:10"
}
]

After padding

Running: left pad test
[
{
    "hostname": "201.nobida.cn",
    "main_metric": "min_time",
    "num_cores": 20,
    "num_threads": 40,
    "ram": 134768111616,
    "runs": [
        {
            "min_time": 0.083000,
            "query": "SELECT max(length(MobilePhoneModel)) FROM hashfile"
        },
        {
            "min_time": 0.098000,
            "query": "SELECT max(length(Params)) FROM hashfile"
        },
        {
            "min_time": 0.399000,
            "query": "SELECT max(length(Title)) FROM hashfile"
        },
        {
            "min_time": 0.139000,
            "query": "SELECT max(length(URLDomain)) FROM hashfile"
        },
        {
            "min_time": 0.116000,
            "query": "SELECT max(length(PageCharset)) FROM hashfile"
        },
        {
            "min_time": 0.424000,
            "query": "SELECT max(length(Referer)) FROM hashfile"
        },
        {
            "min_time": 0.492000,
            "query": "SELECT max(length(URL)) FROM hashfile"
        },
        {
            "min_time": 0.072000,
            "query": "SELECT max(length(UTMSource)) FROM hashfile"
        }
    ],
    "server_version": "18.16.0",
    "test_name": "left pad test",
    "time": "2018-12-24 22:47:23"
}
]

@alexey-milovidov alexey-milovidov merged commit de88010 into ClickHouse:master Dec 25, 2018
@alexey-milovidov alexey-milovidov self-requested a review December 25, 2018 19:00
alexey-milovidov added a commit that referenced this pull request Dec 25, 2018
alexey-milovidov added a commit that referenced this pull request Dec 27, 2018
alexey-milovidov added a commit that referenced this pull request Dec 27, 2018
alexey-milovidov added a commit that referenced this pull request Dec 27, 2018
alexey-milovidov added a commit that referenced this pull request Dec 27, 2018
alexey-milovidov added a commit that referenced this pull request Dec 27, 2018
alexey-milovidov added a commit that referenced this pull request Dec 27, 2018
alexey-milovidov added a commit that referenced this pull request Jan 8, 2019
alexey-milovidov added a commit that referenced this pull request Jan 8, 2019
alexey-milovidov added a commit that referenced this pull request Jan 8, 2019
alexey-milovidov added a commit that referenced this pull request Jan 8, 2019
alexey-milovidov added a commit that referenced this pull request Jan 8, 2019
alexey-milovidov added a commit that referenced this pull request Jan 8, 2019
@alesapin
Copy link
Member

alesapin commented Feb 7, 2019

@amosbird What is 'hashfile' you referenced in your test?

@amosbird
Copy link
Collaborator Author

@alesapin It's a data file shared by @alexey-milovidov

It has the following schema and I use it for hash testing

DESCRIBE TABLE hashfile

┌─name─────────────┬─type───┬─default_type─┬─default_expression─┬─comment_expression─┬─codec_expression─┐
│ MobilePhoneModel │ String │              │                    │                    │                  │
│ Params           │ String │              │                    │                    │                  │
│ Title            │ String │              │                    │                    │                  │
│ URLDomain        │ String │              │                    │                    │                  │
│ PageCharset      │ String │              │                    │                    │                  │
│ Referer          │ String │              │                    │                    │                  │
│ URL              │ String │              │                    │                    │                  │
│ UTMSource        │ String │              │                    │                    │                  │
└──────────────────┴────────┴──────────────┴────────────────────┴────────────────────┴──────────────────┘

@alexey-milovidov
Copy link
Member

Selected columns from test.hits.

@alexey-milovidov
Copy link
Member

@alesapin If you substitute test.hits for hashfile it will work.

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.

3 participants