Skip to content

Bad performance with diffChars method. #225

Closed
@chemzqm

Description

@chemzqm

It's really slow when you have lots of content remove in new string.

const fs = require('fs')
const diff =require('diff')

let arr = new Array(3000)
let content = arr.fill('a').join('\n')
let ts = Date.now()
diff.diffChars('', content)
console.log('time:' + (Date.now() - ts) + 'ms')
console.log('length:' + content.length)

Result:

time:2985ms
length:5999

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions