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

dev: Reduce bundle size #334

Open
Gaspero opened this issue Nov 15, 2023 · 0 comments
Open

dev: Reduce bundle size #334

Gaspero opened this issue Nov 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Gaspero
Copy link

Gaspero commented Nov 15, 2023

Codebase Improvement Request

Describe the Codebase Improvement Request

I use "Import Cost" VSCode extention which utilizes webpack in order to detect the imported package size.

Снимок экрана 2023-11-15 в 19 44 28

For ydb-sdk it shows a red line "2.4M (gzipped: 469.7k)" indicating that this package could affect UX in full-stack frameworks and increase initial page load times.

I understand, that this is in fact an issue related to ydb-nodejs-genproto package, which is used internally to compile proto files.
I even tried to use different libraries for compiling to reduce the size.
Results could be examined in different branches of my fork https://github.com/Gaspero/ydb-nodejs-genproto

ts-proto & buf (master branch)

buf.gen.yaml

version: v1
plugins:
  - name: ts
    out: src/generated
    strategy: all
    path: node_modules/ts-proto/protoc-gen-ts_proto

Size in kb

1496    protos
    420     ydb_table.ts
    308     ydb_topic.ts
    148     ydb_coordination.ts
    112     ydb_cms.ts
    84      ydb_monitoring.ts
    60      ydb_value.ts
    56      ydb_rate_limiter.ts
    48      ydb_scheme.ts
    48      ydb_export.ts
    40      ydb_import.ts
    36      ydb_operation.ts
    32      ydb_scripting.ts
    24      ydb_query_stats.ts
    20      ydb_discovery.ts
    12      ydb_issue_message.ts
    12      ydb_common.ts
    12      annotations
    8       ydb_status_codes.ts
    8       ydb_formats.ts
    8       ydb_auth.ts
204     google
    204     protobuf
        160     descriptor.ts
        16      struct.ts
        8       timestamp.ts
        8       duration.ts
        8       any.ts
        4       empty.ts
16      ydb_table_v1.ts
8       ydb_topic_v1.ts
4       ydb_scripting_v1.ts
4       ydb_scheme_v1.ts
4       ydb_rate_limiter_v1.ts
4       ydb_operation_v1.ts
4       ydb_monitoring_v1.ts
4       ydb_import_v1.ts
4       ydb_export_v1.ts
4       ydb_discovery_v1.ts
4       ydb_coordination_v1.ts
4       ydb_cms_v1.ts
4       ydb_auth_v1.ts

protoc-gen-ts

Size in kb

2100    src/generated/protos
224     src/generated/google
36      src/generated/ydb_table_v1.ts
16      src/generated/ydb_topic_v1.ts
16      src/generated/ydb_rate_limiter_v1.ts
12      src/generated/ydb_scheme_v1.ts
12      src/generated/ydb_operation_v1.ts
12      src/generated/ydb_coordination_v1.ts
12      src/generated/ydb_cms_v1.ts
8       src/generated/ydb_scripting_v1.ts
8       src/generated/ydb_monitoring_v1.ts
8       src/generated/ydb_import_v1.ts
8       src/generated/ydb_export_v1.ts
8       src/generated/ydb_discovery_v1.ts
4       src/generated/ydb_auth_v1.ts
@Gaspero Gaspero added the enhancement New feature or request label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant