Skip to content

Commit

Permalink
fixed calculate text length to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jun 28, 2024
1 parent c1b2954 commit a7fccde
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/converter/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,8 @@ const convertV8List = (v8list, options) => {
rangeCache: new Map(),
diffCache: new Map(),
// cacheHits: 0,
// textLength: [],

// coverage info
bytes: [],
functions: [],
Expand Down Expand Up @@ -1580,6 +1582,11 @@ const convertV8List = (v8list, options) => {

// stateList.forEach((st) => {
// console.log('diffCache', st.diffCache.size, 'cacheHits', st.cacheHits);
// const textLength = st.textLength;
// console.log('< 50', textLength.filter((v) => v < 50).length);
// console.log('< 80', textLength.filter((v) => v < 80).length);
// console.log('< 100', textLength.filter((v) => v < 100).length);
// console.log('< 500', textLength.filter((v) => v < 500).length);
// });

Util.logTime(` ┌ [convert] converted data list (${dataFiles})`, time_start_convert);
Expand Down
10 changes: 9 additions & 1 deletion lib/converter/find-original-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,16 @@ const getAlignPosition = (info, direction) => {
const gp = info.generatedPos;
const ot = info.originalText;


// < 50 338819
// < 80 359473
// < 100 362796
// < 500 366490
// info.state.textLength.push(gt.length);
// info.state.textLength.push(ot.length);

// there is no need to align for long text
const maxLength = 500;
const maxLength = 100;
if (gt.length > maxLength || ot.length > maxLength) {
// console.log(gt.length, ot.length, gp);
return;
Expand Down

0 comments on commit a7fccde

Please sign in to comment.