Java · LGPL-3.0 · release 1.0.7-vanteam.1

VANTEAM BSL Language Server

BSL Language Server 1.0.7 that checks a 1C module about as cheaply as 0.29 did, with every 1.0.7 finding intact.

+syntax-helper disk cache+--target+OOM loop guard−Sentry
×0.26–0.47CPU time versus stock 1.0.7 on seven scenarios
7 / 7scenarios faster than 0.29.0 in wall time
0changed findings among 81,896 compared diagnostics

CPU seconds per check

median of 5 paired rounds, one new JVM per run
0 s20 s40 s60 s80 sSmall moduleSmall module — stock 1.0.7: 54 sSmall module — fork: 14 sSmall module — 0.29.0: 20 s5414Medium moduleMedium module — stock 1.0.7: 55 sMedium module — fork: 16 sMedium module — 0.29.0: 20 s5516Large moduleLarge module — stock 1.0.7: 52 sLarge module — fork: 18 sLarge module — 0.29.0: 21 s5218Form moduleForm module — stock 1.0.7: 73 sForm module — fork: 32 sForm module — 0.29.0: 31 s7332Five modulesFive modules — stock 1.0.7: 73 sFive modules — fork: 23 sFive modules — 0.29.0: 29 s7323Cross-moduleCross-module — stock 1.0.7: 60 sCross-module — fork: 17 sCross-module — 0.29.0: 24 s6017Mini configurationMini configuration — stock 1.0.7: 72 sMini configuration — fork: 29 sMini configuration — 0.29.0: 34 s7229
stock 1.0.7fork + CDS + ru help0.29.0
Why a fork

1.0.7 re-read the 1C syntax helper on every run

BSL Language Server 1.0.7 infers types from the syntax helper of the installed 1C platform: 2,495 contexts, about 75 MB of HBK files, parsed at every start. On a single-module check that is most of the CPU time, and a short CLI run paid ×2.6–3.5 the CPU of 0.29.0. The fork keeps the parsed helper on disk and changes nothing in how rules work.

Changes from upstream v1.0.7

ChangeCommit
Disk cache of the parsed syntax helper (Kryo). The key covers the helper files (path, size, mtime, edge hashes), the engine, bsl-context, Kryo and Java versions; a miss, a write and a broken entry are logged at INFO; writes are atomic. app.platform-context.cache.enabled, app.platform-context.cache.pathperf(types)
analyze --target <file>: the whole source directory is the context, diagnostics and metrics are computed for the targets onlyperf(cli)
No retry storm after OutOfMemoryError while loading the helper: one attempt, an ERROR line, platform context off for the workspacefix(types)
Error reports are no longer sent to the upstream Sentry projectchore(vanteam)

The full upstream test suite passes on the fork: 3,666 tests, 0 failures, 31 skipped (mostly tests that need the 1C syntax helper).

Measurements

Faster than 0.29.0 in wall time, stock-level findings

Seven scenarios from a single module to a mini configuration with metadata. Every run is a new JVM; a warm-up, then five rounds with shifted and reversed order; medians of paired ratios inside a round. All variants use -XX:TieredStopAtLevel=1 -XX:ActiveProcessorCount=4 -Xmx512m. The fork variant adds the warm cache, an AppCDS archive of the extracted JAR and the Russian-only syntax helper. 4 cores / 8 threads under 60–94% background load, so CPU time is the primary metric.

CPU seconds per check

0 s20 s40 s60 s80 sSmall moduleSmall module — stock 1.0.7: 53.9 sSmall module — fork: 13.5 sSmall module — 0.29.0: 19.7 s53.913.5Medium moduleMedium module — stock 1.0.7: 55.4 sMedium module — fork: 15.6 sMedium module — 0.29.0: 19.9 s55.415.6Large moduleLarge module — stock 1.0.7: 52.2 sLarge module — fork: 17.6 sLarge module — 0.29.0: 20.9 s52.217.6Form moduleForm module — stock 1.0.7: 72.8 sForm module — fork: 32.3 sForm module — 0.29.0: 30.6 s72.832.3Five modulesFive modules — stock 1.0.7: 73.1 sFive modules — fork: 23.2 sFive modules — 0.29.0: 29.0 s73.123.2Cross-moduleCross-module — stock 1.0.7: 59.9 sCross-module — fork: 17.0 sCross-module — 0.29.0: 24.0 s59.917.0Mini configurationMini configuration — stock 1.0.7: 71.8 sMini configuration — fork: 29.1 sMini configuration — 0.29.0: 34.3 s71.829.1
stock 1.0.7fork + CDS + ru help0.29.0

Fork versus stock 1.0.7: ×0.26–0.47. Not more CPU than 0.29.0 in 6 of 7 scenarios; the form module is 6% above it.

Wall time per check

0 s20 s40 s60 s80 sSmall moduleSmall module — stock 1.0.7: 35.1 sSmall module — fork: 11.5 sSmall module — 0.29.0: 17.8 s35.111.5Medium moduleMedium module — stock 1.0.7: 37.0 sMedium module — fork: 18.8 sMedium module — 0.29.0: 21.1 s37.018.8Large moduleLarge module — stock 1.0.7: 28.9 sLarge module — fork: 11.8 sLarge module — 0.29.0: 15.9 s28.911.8Form moduleForm module — stock 1.0.7: 35.9 sForm module — fork: 15.6 sForm module — 0.29.0: 21.9 s35.915.6Five modulesFive modules — stock 1.0.7: 74.8 sFive modules — fork: 27.0 sFive modules — 0.29.0: 44.8 s74.827.0Cross-moduleCross-module — stock 1.0.7: 40.7 sCross-module — fork: 11.8 sCross-module — 0.29.0: 30.8 s40.711.8Mini configurationMini configuration — stock 1.0.7: 45.3 sMini configuration — fork: 19.4 sMini configuration — 0.29.0: 33.3 s45.319.4
stock 1.0.7fork + CDS + ru help0.29.0

Fork versus stock 1.0.7: ×0.30–0.47.

Peak memory per check

0 MiB200 MiB400 MiB600 MiB800 MiBSmall moduleSmall module — stock 1.0.7: 698 MiBSmall module — fork: 371 MiBSmall module — 0.29.0: 236 MiB698371Medium moduleMedium module — stock 1.0.7: 701 MiBMedium module — fork: 377 MiBMedium module — 0.29.0: 230 MiB701377Large moduleLarge module — stock 1.0.7: 699 MiBLarge module — fork: 421 MiBLarge module — 0.29.0: 250 MiB699421Form moduleForm module — stock 1.0.7: 701 MiBForm module — fork: 495 MiBForm module — 0.29.0: 450 MiB701495Five modulesFive modules — stock 1.0.7: 696 MiBFive modules — fork: 421 MiBFive modules — 0.29.0: 302 MiB696421Cross-moduleCross-module — stock 1.0.7: 703 MiBCross-module — fork: 435 MiBCross-module — 0.29.0: 312 MiB703435Mini configurationMini configuration — stock 1.0.7: 704 MiBMini configuration — fork: 442 MiBMini configuration — 0.29.0: 438 MiB704442
stock 1.0.7fork + CDS + ru help0.29.0

Fork versus stock 1.0.7: ×0.53–0.70; still ×1.1–1.6 of 0.29.0, which does not load the helper at all.

One launch, many modules

0 s30 s60 s90 s120 s183267stock 1.0.7 — 1 modules: 62.6 s CPUstock 1.0.7 — 8 modules: 77.9 s CPUstock 1.0.7 — 32 modules: 88.9 s CPUstock 1.0.7 — 67 modules: 100.1 s CPU100.1 s1.0.7 + CDS + ru help — 1 modules: 36.5 s CPU1.0.7 + CDS + ru help — 8 modules: 48.8 s CPU1.0.7 + CDS + ru help — 32 modules: 71.3 s CPU1.0.7 + CDS + ru help — 67 modules: 78.9 s CPU78.9 sfork — 1 modules: 19.2 s CPUfork — 8 modules: 28.3 s CPUfork — 32 modules: 45.5 s CPUfork — 67 modules: 66.5 s CPU66.5 s
stock 1.0.71.0.7 + CDS + ru helpfork + CDS + ru help

CPU seconds for one launch over N common modules. The fork's fixed part is about 19 s against 62 s; each extra module costs 0.6–0.7 s, so checking changed modules in one launch is far cheaper than one launch per module.

Medians: wall / CPU, s
Scenario0.29.0stock 1.0.71.0.7 + CDS + ru helpfork, warm cachefork, cold cachefork + --target
Small module17.8 / 19.735.1 / 53.920.7 / 30.311.5 / 13.519.9 / 29.814.3 / 14.4
Medium module21.1 / 19.937.0 / 55.416.6 / 29.818.8 / 15.620.8 / 30.017.1 / 15.0
Large module15.9 / 20.928.9 / 52.217.8 / 33.811.8 / 17.617.8 / 32.610.6 / 16.3
Form module21.9 / 30.635.9 / 72.841.9 / 50.615.6 / 32.328.5 / 51.717.1 / 32.0
Five modules44.8 / 29.074.8 / 73.151.2 / 43.927.0 / 23.249.9 / 42.431.3 / 17.8
Cross-module30.8 / 24.040.7 / 59.920.0 / 33.811.8 / 17.019.4 / 33.411.4 / 16.1
Mini configuration33.3 / 34.345.3 / 71.826.5 / 44.319.4 / 29.132.9 / 45.118.3 / 23.0
Findings

Nothing changes but the price

Findings are compared as multisets of full JSON diagnostics by full path. The fork with a warm or a cold cache, the fork with --target and stock 1.0.7 with the Russian-only helper produced exactly the stock 1.0.7 findings everywhere, with no WARN or ERROR lines.

Real configurations, one run per variant

CorpusFindingsFork CPUFork + --target CPUResult
Configuration A · 76 modules8,051×0.77×0.27identical
Configuration B · 596 common modules71,460×1.03×0.17identical

On a whole configuration the analysis dominates and the cache gains little; --target checks one module against the full context for a sixth of the CPU. Stock 1.0.7 needs -Xmx1g for 596 modules: with 512 MiB it fails with OutOfMemoryError.

Seven scenarios

ScenarioFindingsFork, warm / cold / --target
Small module0identical
Medium module63identical
Large module338identical
Form module1,102identical
Five modules205identical
Cross-module5identical
Mini configuration672identical

0.29.0 differs from 1.0.7 as engines do, e.g. on the form module −25 UnusedLocalMethod and +2 UselessTernaryOperator; these differences are not part of the acceptance.

Robustness

A cache you can invalidate, a failure you can see

Cache invalidation: 8 of 8 steps as expected

StepCache event
first run, then a second onemiss + written, then hit
another platform directorymiss + written, then hit
helper file modification time changedmiss
cache file corruptedunreadable, written, then hit
back to the original platformhit

Findings of every run equal the first one. One entry is 23.3 MB, three entries are kept. A hit costs 20–23 s of CPU on the small module against 51–52 s on a miss.

Out of memory while loading the helper

EngineBehaviour
stock 1.0.7loops the helper is parsed again for every next document; the JVM keeps burning CPU until an outside timeout
forkone attempt ERROR line, platform context off, the analysis finishes
stock 1.0.7 + -XX:+ExitOnOutOfMemoryErrorexit 3 in 16 s

Cause: Lazy in utils 0.10.1 does not memoize an exception, and the holder caught Exception only.

Use it

Build and run

JDK 21. The command line and the report formats are those of BSL Language Server; the cache is on by default and lives next to the upstream cache unless app.platform-context.cache.path points elsewhere.

# the release JAR (SHA-256 0b75fa12…c205b), or build it: git clone -b vanteam-bsl-1.1 … && ./gradlew bootJar
curl -LO https://github.com/ivanbokhan84/bsl-language-server/releases/download/v1.0.7-vanteam.1/bsl-language-server-1.0.7-vanteam.1-exec.jar

# optional: an AppCDS archive of the extracted JAR, trained once
java -Djarmode=tools -jar bsl-language-server-1.0.7-vanteam.1-exec.jar extract --destination bslls
java -XX:ArchiveClassesAtExit=bslls.jsa -jar bslls/bsl-language-server-*-exec.jar --analyze --srcDir src --silent

java -XX:SharedArchiveFile=bslls.jsa -XX:TieredStopAtLevel=1 -XX:ActiveProcessorCount=4 \
     -Xmx1g -XX:+ExitOnOutOfMemoryError \
     -jar bslls/bsl-language-server-*-exec.jar --analyze --silent \
     --srcDir src --target src/CommonModules/Module1/Ext/Module.bsl --reporter json

Russian-only helper: point v8platform.binPath to a directory with copies of shcntx_ru.hbk, shlang_ru.hbk and shlang_root.hbk (no shcntx_root.hbk). The English helper is skipped; findings stayed identical on 79,511 diagnostics of two real configurations.