Generating Compile Cache Ahead of Runtime
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.3k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 283
Mô tả
What is the problem this feature will solve?
It is currently not possible to generate the compile cache without executing the files that will be cached.
Currently, container images and lambda functions can't easily generate code caches ahead of the actual runtime, since the code may have effects you may not want to execute early.
What is the feature you are proposing to solve the problem?
Would it be possible to add a way to generate the compile cache without executing the relevant files, i.e. walking the module tree from the entry point, generating caches along the way?
Perhaps something like node --generate-compile-cache path/to/entrypoint.mjs
and/or
module.generateCompileCache("path/to/entrypoint.mjs")
What alternatives have you considered?
You may be able to work around this by adding "dry-run" code paths specifically for code cache generation, but this is a hacky workaround that can require massive effort.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách xem xét hành vi compile-cache hiện có của Node.js và các entrypoint được đề xuất --generate-compile-cache và module.generateCompileCache(). Xác định cách có thể duyệt cây module của một entrypoint mà không thực thi mã ứng dụng. Công việc được xem là hoàn tất khi có một cách được lập tài liệu và đã được kiểm thử để tạo compile cache liên quan trước khi runtime.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, node.js
- Lĩnh vực
- backend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100