question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

completion: listing constructors is slow

See original GitHub issue

CPU: Intel® Core™ i7-10700 CPU @ 2.90GHz *8 cores OS: Windows 10 Test project: a simple maven project with no extra dependency Use case: complete for new constructor

    public String sayHello() {
        new S‸
    }

profiling details:

image

Sample response:

Because my CPU is relative powerful, 263ms is not a small number. It can be up to 1s on my other machines. one item from completion response:

Received response 'textDocument/completion - (108)' in 263ms.
Result: {
    "isIncomplete": false,
    "items": [
...
{
            "label": "SAXException()",
            "kind": 4,
            "detail": "org.xml.sax.SAXException.SAXException()",
            "sortText": "999999163",
            "insertText": "SAXException",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 7,
                        "character": 12
                    },
                    "end": {
                        "line": 7,
                        "character": 13
                    }
                },
                "newText": "SAXException()"
            },
            "data": {
                "decl_signature": "Lorg.xml.sax.SAXException;",
                "signature": "()V",
                "name": "SAXException",
                "pid": "65",
                "rid": "7",
                "uri": "file:///C:/Users/yanzh/Desktop/maven-dependency-conflict-demo-master/project-commmon/src/main/java/projectcommon/HelloWorld.java"
            }
...

response of resolve request:

Received response 'completionItem/resolve - (109)' in 6ms.
Result: {
    "label": "SAXException()",
    "kind": 4,
    "detail": "org.xml.sax.SAXException.SAXException()",
    "documentation": {
        "kind": "markdown",
        "value": "Create a new SAXException."
    },
    "sortText": "999999163",
    "insertTextFormat": 2,
    "textEdit": {
        "range": {
            "start": {
                "line": 7,
                "character": 12
            },
            "end": {
                "line": 7,
                "character": 13
            }
        },
        "newText": "SAXException()"
    },
    "additionalTextEdits": [
        {
            "range": {
                "start": {
                    "line": 0,
                    "character": 22
                },
                "end": {
                    "line": 2,
                    "character": 0
                }
            },
            "newText": "\n\nimport org.xml.sax.SAXException;\n\n"
        }
    ]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fbriconcommented, Aug 18, 2021

There’s a whole bunch of StringBuffers in that class, moving to StringBuilders won’t hurt

0reactions
testforstephencommented, Aug 26, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

C++ Constructors vs Initialization Lists speed comparison
I have a set of objects that needs to be created frequently and would like to know if there is any performance gain...
Read more >
Construction Punch Lists Explained - Levelset
A punch list is a document that lists final work items remaining before a construction project is considered complete.
Read more >
How do I troubleshoot slow performance in Sage 300 ...
Describe the nature of the slowness with as much detail as possible, indicating the actual time to complete compared with the expected or ......
Read more >
3 Reasons Federal Construction Procurement Can Be Slow
Federal government construction procurement moves even slower. Regulations and mandated procedures bottleneck efforts to complete projects on time and ...
Read more >
The Housing Shortage Will Worsen—Don't Expect Builders To ...
Builders are slowing down the pace of construction amid a punishing ... homes builders have begun construction on but haven't yet completed, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found