Giter VIP home page Giter VIP logo

Comments (6)

leodevbro avatar leodevbro commented on September 26, 2024

Hello, please tell me the size of the specific file on which Blockman needs many seconds to render blocks.

I have tested Blockman on 5000 line TypeScript file and it needs no more than 1-2 seconds to render blocks. Often less than 1 second.

If your file has more than 5000 or more than 10000 lines, then I guess we cannot do much about it, because VS Code does not give extensions access to the natively optimized parsed tokens, so extensions have to parse/tokenize themselves and it is not optimized, because we, extension developers, don't always have the super knowledge and experience of writing optimized tokenization algorithms for so many languages.

So, after analyzing file, rendering blocks is always fast. The analyzation process is slow because of the VS Code limitation I mentioned above.
I hope VS Code will soon give extensions access to the native tokens.

Also, one noteworthy thing is that Blockman uses 1.2 seconds (you can change this number) debouncing for every render and for every text change event to rerender blocks. You can change it to maybe 0.2 seconds, but probably it will be too much load on the CPU.

microsoft/vscode#177452

from vscode-blockman.

BacemJ avatar BacemJ commented on September 26, 2024

I encountered the same issue not in first load but when scrolling up and down in the file it stuck to render the file has 158 lines only but it stuck.
I loved the extension but it stuck in the rendering
I use vs code in Windows 10

from vscode-blockman.

leodevbro avatar leodevbro commented on September 26, 2024

file has 158 lines only but it stuck

@BacemJ, this is very strange. 158 lines is very little code, I have never seen Blockman stuck on 100-200 lines file. Could you please provide the exact file text? So I will be able to test it on my environment, maybe the file has some kind of "edge case" code in it? I don't know.

from vscode-blockman.

leonard-henriquez avatar leonard-henriquez commented on September 26, 2024

If your file has more than 5000 or more than 10000 lines, then I guess we cannot do much about it, because VS Code does not give extensions access to the natively optimized parsed tokens, so extensions have to parse/tokenize themselves and it is not optimized, because we, extension developers, don't always have the super knowledge and experience of writing optimized tokenization algorithms for so many languages.

Unfortunately that's the case because I have a few generated files (like the Prisma Client) that are a few thousands lines long.
So I had to disable the Blockman extension :'(

from vscode-blockman.

leodevbro avatar leodevbro commented on September 26, 2024

@leonard-henriquez, maybe you don't need to completely disable or uninstall it. Blockman has customizable black list of file formats to ignore files with specific formats, for example: prisma, plaintext, markdown, css, less, scss, html, json, jsonc, typescriptreact, typescript, javascriptreact, javascript, python, go, dart, php, c, csharp, cpp, java.

Also Blockman has quick toggle (disable/enable) command to disable when it is not convenient to use it and reenable it quickly.
Just press F1 and type blockman toggle and you will find two kinds of enable/disable toggle commands.

1] simple enable/disable
2] enable/disable with forced show/hide indent guides of VS Code.

from vscode-blockman.

barisx avatar barisx commented on September 26, 2024

it is super slow also on my mac. but i can't say cause of typescript. as far as i saw it has trying optimization. it renders only when i change new code sections.

from vscode-blockman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.