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

Add progress indicator when loading large trees #11

Open
dnwerner opened this issue Aug 28, 2021 · 12 comments
Open

Add progress indicator when loading large trees #11

dnwerner opened this issue Aug 28, 2021 · 12 comments
Labels
blocked enhancement New feature or request

Comments

@dnwerner
Copy link

It would be very helpful to show a progress indicator while loading large trees, because sometimes loading apparently stalls and loading of large trees can take quite a while.

@AlbertoPdRF AlbertoPdRF added enhancement New feature or request blocked labels Jun 28, 2022
@AlbertoPdRF
Copy link
Owner

I believe this is something that should be handled in JSROOT's side, so I'm adding @linev to the issue so he knows about your suggestion! 🙂

@linev
Copy link
Contributor

linev commented Jul 1, 2022

Probably I understand source of the problem.

Seems to be, inside WebView JSROOT tries to load content of complete ROOT file.
May be WebView does not support partial requests.

@AlbertoPdRF, can you point me place in the code where access to ROOT file is provided?

With normal HTTP progress bar appears and JavaScript VM in browser uses moderate amount of memory (~10MB)

https://jsroot.gsi.de/latest/?file=https://jsroot.gsi.de/files/tmp/large.root&item=ntuple;133/px

@AlbertoPdRF
Copy link
Owner

I'm not entirely sure where to point you. Do you mean this line? Or this function?

The first is when I think that the file is actually being read, but I don't know if it's loaded in memory or something before. The second is the function VS Code calls with a file uri for our extension to return a new CustomDocument for that resource, but in our case everything that should happen at this point is that the uri gets saved for later usage.

@linev
Copy link
Contributor

linev commented Jul 1, 2022

Yes, this is exactly I was asking for.

And most probably here partial reading is not works.
All kinds of such interfaces ignores "Ranges" settings in requests.

The only solution would be: https://code.visualstudio.com/api/extension-guides/webview#scripts-and-message-passing

I can add support for arbitrary I/O proxy to JSROOT.
Once it is there, we could try to use it inside WebView

@AlbertoPdRF
Copy link
Owner

If you think that could work, I'm down for it!

@linev
Copy link
Contributor

linev commented Jul 4, 2022

@AlbertoPdRF

I trying to use your extension from local disk, but somehow fail.
That exactly I should do to get it running - I want to test changes concerning large files reading

@AlbertoPdRF
Copy link
Owner

From the base folder of the extension, in a terminal:

  1. yarn
  2. code .

Once VS Code opens:

  1. F5

I believe it should be enough with that, let me know if you have any problems!

@linev
Copy link
Contributor

linev commented Jul 5, 2022

Now I got it!
I create PR - only to show code: #20

Can you check how node modules can be used inside?

@linev
Copy link
Contributor

linev commented Jul 7, 2022

Finally PR #20 is working with large files.
Also images can be stored directly.
One also can enable back 'tabs' layout - JSROOT master supports it now

@dnwerner
Copy link
Author

Is there any progress on the issue?
On slow internet connections some files containing ~150 histograms (mixed TH1 and TH2, file size: 60 MB) start to load, but simply stop after a while (the loading indicator just vanished and nothing happens anymore). Are there internal timeouts interrupting the loading progress?

@AlbertoPdRF
Copy link
Owner

Hey @dnwerner, sorry for the very late reply, I was busy finalizing my PhD and other stuff.

Sadly, there has never been a reply by the VS Code guys regarding the issue blocking #20. I will try to look for a workaround to land it, as it's been way too long now.

@dnwerner
Copy link
Author

dnwerner commented Jun 6, 2023

Hey @AlbertoPdRF,

no problem! Thanks for the reply and good luck with your PhD! :)
I currently work around the issue by manually copying the files I want to view onto my machine and accessing them locally (not ideal, but no deal breaker).

If you find the time, the larger problem for our team currently seems to be #3 (bright text on white tabs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants