Skip to content

Faster first page: start new workspaces from the demo by linking its large files - #279

Merged
t0mdavid-m merged 1 commit into
developfrom
claude/project-thread-bs44j8
Nov 13, 2026
Merged

t0mdavid-m merged 1 commit into
developfrom
claude/project-thread-bs44j8

Conversation

@t0mdavid-m

Copy link
Copy Markdown
Member

Requested by Tom · project thread

Needs OpenMS/streamlit-template#571 (same common.py and consent bundle changes; the template sync will bring them in without conflict once both are merged).

Why

A new visitor on flashapp.webapps.openms.de waits 12–14 s before the consent banner and captcha appear. The captcha itself takes under 1 s; about 7 s is the server copying the 297 MB example workspace into the new session's workspace before the first page is sent (live waterfall: scripts loaded at 2.2 s, no server frames until 9.2 s).

What changes

  • settings.json: demo_workspaces.new_workspace: "default", so a new workspace starts from the demo through the template's seed_new_workspace(), replacing FLASHApp's own copy in page_setup().
  • src/common/common.py: the template's seed_new_workspace() / copy_demo_workspace(): files of 1 MiB or more are linked, smaller ones copied. For the demo: 48 files (286 MB) linked, 132 (11 MB) copied.
  • src/workflow/FileManager.py: store_data and store_file remove a link before writing, so storing a result again writes a file of the workspace's own and never into the shared demo.
  • Consent banner script built in production mode: 962 KB → 183 KB.

Timings

  • Seeding a new workspace (local SSD): 0.22 s and 297 MB written → 0.02 s and 11 MB. On the cluster's NFS volume the copy is the ~7 s gap.
  • New browser until the captcha shows (online mode, local SSD, three runs): 2.0–3.4 s → 1.6–2.7 s.

Screenshots

Live now (12–14 s) Local, after

Video of the live first load today: live-before-first-load.mp4

Explore results on a workspace started this way (linked example data, the demo unchanged afterwards):

Tests

  • New tests/test_file_manager_links.py: store_data and store_file replace a linked file and leave the demo unchanged.
  • python -m pytest tests/: 1123 passed, 2 skipped. pylint --errors-only on the changed files: clean.


Generated by Claude Code

A new online session copied the whole example workspace (about 300 MB)
before the page drew anything, which made the first page, the consent
banner and the captcha take 10 s or more. The demo's large files are
now linked and only small files copied (the template's
seed_new_workspace), and FileManager replaces a link before it stores a
result, so the shared demo is never written to. The consent bundle is
built in production mode (183 KB instead of 1 MB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FkEGem9AQZyiiA18C2cHQH
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 01d69c4c-22b9-4c88-80bc-d0a9cfbcdca6
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@t0mdavid-m
t0mdavid-m merged commit cb51f72 into develop Nov 13, 2026
23 checks passed
@t0mdavid-m
t0mdavid-m deleted the claude/project-thread-bs44j8 branch November 13, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants