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

perf: faster substring of rspack-sources #8731

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ rayon = { version = "1.10.0" }
regex = { version = "1.11.1" }
ropey = "1.6.1"
rspack_resolver = { version = "0.3.6", features = ["package_json_raw_json_api"] }
rspack_sources = { version = "0.4.0" }
rspack_sources = { version = "0.4.1" }
rustc-hash = { version = "2.1.0" }
serde = { version = "1.0.215" }
serde = { version = "1.0.216" }
serde_json = { version = "1.0.133" }
simd-json = { version = "0.14.0-rc.2" }
smol_str = { version = "0.3.0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Object {
main.js,
],
filteredModules: undefined,
hash: 03ac15d52ac8f99a,
hash: 6e63c93280ecf7f7,
id: 909,
idHints: Array [],
initial: true,
Expand Down Expand Up @@ -173,7 +173,7 @@ Object {
errorsCount: 0,
filteredAssets: undefined,
filteredModules: undefined,
hash: 25fb71d3c0e584fa,
hash: fbda3282340b27ec,
modules: Array [
Object {
assets: Array [],
Expand Down Expand Up @@ -318,7 +318,7 @@ Object {
main.js,
],
filteredModules: undefined,
hash: 24d8ec2f7276d780,
hash: 6ce6ff107a4c39c2,
id: 909,
idHints: Array [],
initial: true,
Expand Down Expand Up @@ -685,7 +685,7 @@ Object {
errorsCount: 0,
filteredAssets: undefined,
filteredModules: undefined,
hash: c9ae05e2791de1df,
hash: 827e507540787a7e,
modules: Array [
Object {
assets: Array [],
Expand Down Expand Up @@ -1449,7 +1449,7 @@ Object {
files: Array [
main.js,
],
hash: 03ac15d52ac8f99a,
hash: 6e63c93280ecf7f7,
id: 909,
idHints: Array [],
initial: true,
Expand Down Expand Up @@ -1589,7 +1589,7 @@ Object {
main.js,
],
filteredModules: undefined,
hash: 9c0983c99ff070fd,
hash: cb183b73192ba5e0,
id: 909,
idHints: Array [],
initial: true,
Expand Down Expand Up @@ -1937,7 +1937,7 @@ exports.c = require("./c?c=3");,
errorsCount: 0,
filteredAssets: undefined,
filteredModules: undefined,
hash: 7973d0469464a339,
hash: 19c21d4b968cc3c3,
modules: Array [
Object {
assets: Array [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ runtime modules 1.61 KiB
[no exports]
[used exports unknown]

Rspack compiled successfully (4d5fa5d34acd771d)
Rspack compiled successfully (9e7a7088bc7f5f5b)
`;

exports[`statsOutput statsOutput/builtin-swc-loader-parse-error should print correct stats for 1`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```javascript
Array [
Object {
"main.381903af5a0c33ed.js": (() => { // webpackBootstrap
"main.a4b9ef476180b3fb.js": (() => { // webpackBootstrap
var __webpack_modules__ = ({
"600": (function (module) {
module.exports = "This is hook"
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-test-tools/tests/statsAPICases/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
entry ./fixtures/a
cjs self exports reference self [585] ./fixtures/a.js

Rspack compiled successfully (25fb71d3c0e584fa)
Rspack compiled successfully (fbda3282340b27ec)
`);
}
};
4 changes: 2 additions & 2 deletions packages/rspack-test-tools/tests/statsAPICases/chunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
chunkB.js,
],
filteredModules: undefined,
hash: 11045cb6792bbfb1,
hash: cea3fd1b25a4eb4d,
id: 250,
idHints: Array [],
initial: false,
Expand Down Expand Up @@ -144,7 +144,7 @@ module.exports = {
main.js,
],
filteredModules: undefined,
hash: 294dacc6fb1d2652,
hash: 582278c180fdbd81,
id: 909,
idHints: Array [],
initial: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ __webpack_require__.e = function (chunkId) {
// webpack/runtime/get_full_hash
(() => {
__webpack_require__.h = function () {
return "ae884e9ae01bc3c32ef3";
return "c4e695e4a317b7bf38b8";
};

})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ __webpack_require__.e = function (chunkId) {
// return url for filenames not based on template

// return url for filenames based on template
return "" + chunkId + ".$" + {"\\css\\chunk": "d0e08c0a6c7f57622c03","\\js\\chunk": "4417803b080d011de306",}[chunkId] + "$.js";
return "" + chunkId + ".$" + {"\\css\\chunk": "b1b844425027e2012f17","\\js\\chunk": "033244835a8df445c8ec",}[chunkId] + "$.js";
};

})();
Expand All @@ -107,7 +107,7 @@ __webpack_require__.e = function (chunkId) {
// webpack/runtime/get_full_hash
(() => {
__webpack_require__.h = function () {
return "b509c1f0031feb6a88cc";
return "78ebdcf52651ae0b1318";
};

})();
Expand Down
32 changes: 16 additions & 16 deletions tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ Rspack x.x.x compiled successfully in X.23"
`;

exports[`StatsTestCases should print correct stats for commons-plugin-issue-4980 1`] = `
"asset app.5501e020a5583695-1.js 52 bytes [emitted] [immutable] (name: app)
"asset app.6c52cde9bb1281c0-1.js 52 bytes [emitted] [immutable] (name: app)
orphan modules 205 bytes [orphan] 3 modules
./entry-1.js 67 bytes [built] [code generated]
Rspack x.x.x compiled successfully in X.23

asset app.f6d28aa27785dd40-2.js 52 bytes [emitted] [immutable] (name: app)
asset app.158d9ab2fc9f85b1-2.js 52 bytes [emitted] [immutable] (name: app)
orphan modules 212 bytes [orphan] 3 modules
./entry-2.js 67 bytes [built] [code generated]
Rspack x.x.x compiled successfully in X.23"
Expand Down Expand Up @@ -456,8 +456,8 @@ Rspack x.x.x compiled successfully in X.23"
`;

exports[`StatsTestCases should print correct stats for immutable 1`] = `
"asset 32f0040e97401a22.js 10.4 KiB [emitted] [immutable] (name: main)
asset fa63d87b0520feaf.js 167 bytes [emitted] [immutable]"
"asset 08bdbdde4cb728ad.js 10.4 KiB [emitted] [immutable] (name: main)
asset 7342054f673663df.js 167 bytes [emitted] [immutable]"
`;

exports[`StatsTestCases should print correct stats for import-context-filter 1`] = `
Expand Down Expand Up @@ -540,32 +540,32 @@ Rspack x.x.x compiled with 2 warnings"
`;

exports[`StatsTestCases should print correct stats for issue-7577 1`] = `
"asset a-runtime~main-afa3b3ca9d13c976.js 3.69 KiB [emitted] [immutable] (name: runtime~main)
"asset a-runtime~main-be0b80b4e8cf8871.js 3.69 KiB [emitted] [immutable] (name: runtime~main)
asset a-main-f9892dc0f961d982.js 387 bytes [emitted] [immutable] (name: main)
asset a-all-a_js-c5e9a60a93fca8e7.js 128 bytes [emitted] [immutable] (id hint: all)
Entrypoint main 4.19 KiB = a-runtime~main-afa3b3ca9d13c976.js 3.69 KiB a-all-a_js-c5e9a60a93fca8e7.js 128 bytes a-main-f9892dc0f961d982.js 387 bytes
asset a-all-a_js-cace9eea394248e7.js 128 bytes [emitted] [immutable] (id hint: all)
Entrypoint main 4.19 KiB = a-runtime~main-be0b80b4e8cf8871.js 3.69 KiB a-all-a_js-cace9eea394248e7.js 128 bytes a-main-f9892dc0f961d982.js 387 bytes
runtime modules 2.59 KiB 3 modules
./a.js 18 bytes [built] [code generated]
Rspack x.x.x compiled successfully in X.23

asset b-runtime~main-fe8d7b2736c6ee6b.js 4.38 KiB [emitted] [immutable] (name: runtime~main)
asset b-all-b_js-21ec1ff4bd0d701e.js 453 bytes [emitted] [immutable] (id hint: all)
asset b-runtime~main-24bff1adff67ae2a.js 4.38 KiB [emitted] [immutable] (name: runtime~main)
asset b-all-b_js-f689e3be6ed05e06.js 453 bytes [emitted] [immutable] (id hint: all)
asset b-main-a97968a81f0fafdb.js 420 bytes [emitted] [immutable] (name: main)
asset b-vendors-node_modules_vendor_js-b7a19993a8749c9c.js 173 bytes [emitted] [immutable] (id hint: vendors)
Entrypoint main 5.41 KiB = b-runtime~main-fe8d7b2736c6ee6b.js 4.38 KiB b-vendors-node_modules_vendor_js-b7a19993a8749c9c.js 173 bytes b-all-b_js-21ec1ff4bd0d701e.js 453 bytes b-main-a97968a81f0fafdb.js 420 bytes
asset b-vendors-node_modules_vendor_js-8e4df31a4698ceb4.js 173 bytes [emitted] [immutable] (id hint: vendors)
Entrypoint main 5.41 KiB = b-runtime~main-24bff1adff67ae2a.js 4.38 KiB b-vendors-node_modules_vendor_js-8e4df31a4698ceb4.js 173 bytes b-all-b_js-f689e3be6ed05e06.js 453 bytes b-main-a97968a81f0fafdb.js 420 bytes
runtime modules 3.17 KiB 5 modules
cacheable modules 40 bytes
./b.js 17 bytes [built] [code generated]
./node_modules/vendor.js 23 bytes [built] [code generated]
Rspack x.x.x compiled successfully in X.23

assets by chunk 862 bytes (id hint: all)
asset c-all-b_js-ee8ed41862a518cb.js 480 bytes [emitted] [immutable] (id hint: all)
asset c-all-c_js-b149372834cd415d.js 382 bytes [emitted] [immutable] (id hint: all)
asset c-runtime~main-9d02d33ce841b9f9.js 11.1 KiB [emitted] [immutable] (name: runtime~main)
asset c-all-b_js-b683c5304b71900e.js 480 bytes [emitted] [immutable] (id hint: all)
asset c-all-c_js-2c876c6ecab93d9b.js 382 bytes [emitted] [immutable] (id hint: all)
asset c-runtime~main-96a5d41462ab7f22.js 11.1 KiB [emitted] [immutable] (name: runtime~main)
asset c-main-e071146c113b212b.js 643 bytes [emitted] [immutable] (name: main)
asset c-vendors-node_modules_vendor_js-b7a19993a8749c9c.js 173 bytes [emitted] [immutable] (id hint: vendors)
Entrypoint main 12.1 KiB = c-runtime~main-9d02d33ce841b9f9.js 11.1 KiB c-all-c_js-b149372834cd415d.js 382 bytes c-main-e071146c113b212b.js 643 bytes
asset c-vendors-node_modules_vendor_js-8e4df31a4698ceb4.js 173 bytes [emitted] [immutable] (id hint: vendors)
Entrypoint main 12.1 KiB = c-runtime~main-96a5d41462ab7f22.js 11.1 KiB c-all-c_js-2c876c6ecab93d9b.js 382 bytes c-main-e071146c113b212b.js 643 bytes
runtime modules 9.7 KiB 13 modules
cacheable modules 101 bytes
./c.js 61 bytes [built] [code generated]
Expand Down
Loading