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

Improve publisher list insert time/memory/cpu #9376

Closed
NejcZdovc opened this issue Apr 22, 2020 · 1 comment · Fixed by brave/brave-core#5301
Closed

Improve publisher list insert time/memory/cpu #9376

NejcZdovc opened this issue Apr 22, 2020 · 1 comment · Fixed by brave/brave-core#5301

Comments

@NejcZdovc
Copy link
Contributor

We have a big performance problem on iOS when we are inserting publisher list into db (we need to insert over 600k publishers). We need to review code and fix memory and CPU problems for this process.

@kjozwiak
Copy link
Member

kjozwiak commented Apr 27, 2020

Verification PASSED on macOS 10.15.4 x64 using the following build:

Brave | 1.8.84 Chromium: 81.0.4044.122 (Official Build) (64-bit)
-- | --
Revision | 44f4233f08910d83b146130c1938256a2e05b136-refs/branch-heads/4044@{#963}
OS | macOS Version 10.15.4 (Build 19E287)

Verified that the Publisher List was being downloaded without any issues once brave://rewards was enabled:

[ RESPONSE - OnDownload ]
> time: 1588029200
> result: Success
> http code: 200
> response: Publisher list
> headers accept-ranges: bytes
> headers access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
> headers access-control-allow-methods: GET
> headers access-control-allow-origin: https://rewards.bravesoftware.com
> headers access-control-request-method: GET
> headers age: 564
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 19006799
> headers content-type: application/json; charset=utf-8
> headers date: Mon, 27 Apr 2020 22:57:51 GMT
> headers etag: W/"4b8454a1c57a8bdf4f924f70507b812c"
> headers server: Cowboy
> headers status: 200
> headers vary: Accept-Encoding
> headers via: 1.1 varnish
> headers x-cache: HIT
> headers x-cache-hits: 0
> headers x-frame-options: deny
> headers x-request-id: 79bb2085-eaf8-4293-adc2-6cbbf83afd2c
> headers x-runtime: 2.669314
> headers x-served-by: cache-yyz4545-YYZ
[ END RESPONSE ]

Ensured that brave.com, chess.com and kjozwiak.github.com appeared as verified and displayed the custom banners without any issues.

brave.com example:

Screen Shot 2020-04-27 at 7 14 08 PM

Screen Shot 2020-04-27 at 7 14 15 PM

chess.com example:

Screen Shot 2020-04-27 at 7 14 45 PM

Screen Shot 2020-04-27 at 7 14 52 PM

kjozwiak.github.io example:

Screen Shot 2020-04-27 at 7 15 32 PM

Screen Shot 2020-04-27 at 7 15 42 PM

Also checked and ensured that the server_publisher_info database was populated as per the following:

Screen Shot 2020-04-27 at 7 22 16 PM

Ensured that publisher_info was populated whenever you visited a website:

Screen Shot 2020-04-27 at 7 22 59 PM

Verification passed on

Brave 1.8.85 Chromium: 81.0.4044.122 (Official Build) (64-bit)
Revision 44f4233f08910d83b146130c1938256a2e05b136-refs/branch-heads/4044@{#963}
OS Windows 10 OS Version 1803 (Build 17134.1006)

Verified that the Publisher List was being downloaded without any issues once brave://rewards was enabled:

[ RESPONSE - OnDownload ]
> time: 1588073906
> result: Success
> http code: 200
> response: Publisher list
> headers accept-ranges: bytes
> headers access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
> headers access-control-allow-methods: GET
> headers access-control-allow-origin: https://rewards.bravesoftware.com
> headers access-control-request-method: GET
> headers age: 358
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 19033260
> headers content-type: application/json; charset=utf-8
> headers date: Tue, 28 Apr 2020 11:34:35 GMT
> headers etag: W/"badde5f9b5a50b7a9ae683a56cb877d5"
> headers server: Cowboy
> headers status: 200
> headers vary: Accept-Encoding
> headers via: 1.1 varnish
> headers x-cache: HIT
> headers x-cache-hits: 30
> headers x-frame-options: deny
> headers x-request-id: 6cf80531-c397-45e4-b7f9-7428a3cb3d44
> headers x-runtime: 2.077662
> headers x-served-by: cache-bom18226-BOM
[ END RESPONSE ]

Ensured that brianbondy.com, clifton.io and duckduckgo.com appeared as verified and displayed the custom banners without any issues.

image
image
image
image
image
image

Also checked and ensured that the server_publisher_info database was populated as per the following:
image

Ensured that publisher_info was populated whenever you visited a website:
image

Verification passed on

Brave 1.8.86 Chromium: 81.0.4044.129 (Official Build) (64-bit)
Revision 3d71af9f5704a40b85806f4d08925db24605ba25-refs/branch-heads/4044@{#979}
OS Ubuntu 18.04 LTS

Verified that the Publisher List was being downloaded without any issues once brave://rewards was enabled:

[ RESPONSE - OnDownload ]
> time: 1588171026
> result: Success
> http code: 200
> response: Publisher list
> headers accept-ranges: bytes
> headers access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
> headers access-control-allow-methods: GET
> headers access-control-allow-origin: https://rewards.bravesoftware.com
> headers access-control-request-method: GET
> headers age: 876
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 19170584
> headers content-type: application/json; charset=utf-8
> headers date: Wed, 29 Apr 2020 14:37:03 GMT
> headers etag: W/"28c9c2762e07b939d5068859fac025bf"
> headers server: Cowboy
> headers status: 200
> headers strict-transport-security: max-age=31536000; includeSubDomains
> headers vary: Accept-Encoding
> headers via: 1.1 varnish
> headers x-cache: HIT
> headers x-cache-hits: 0
> headers x-frame-options: deny
> headers x-request-id: 62f1554b-4b69-454a-bd35-2c1532977f3c
> headers x-runtime: 4.994960
> headers x-served-by: cache-hhn4065-HHN
[ END RESPONSE ]

Ensured that brave.com appeared as verified and displayed the custom banners without any issues.

brave.com example:
image
image

Also checked and ensured that the server_publisher_info database was populated as per the following:
image

Ensured that publisher_info was populated whenever you visited a website:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants