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

Performance benchmark!! #153

Open
wants to merge 8 commits into
base: next
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
do not skip for now
zardoy committed Jun 27, 2024
commit e94b4a0fec67c1c3c6530871d0b0a276120f0211
11 changes: 5 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -8,12 +8,11 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
# todo skip already created deploys on that commit
if: >-
github.event.issue.pull_request != '' &&
(
contains(github.event.comment.body, '/benchmark')
)
# if: >-
# github.event.issue.pull_request != '' &&
# (
# contains(github.event.comment.body, '/benchmark')
# )
permissions:
pull-requests: write
steps:

Unchanged files with check annotations Beta

for (const [soundName, sound] of Object.entries(sounds)) {
if (convertedSounds.includes(soundName)) continue
sounds[soundName] = await audioContext.decodeAudioData(sound)

Check warning on line 52 in src/basicSounds.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
convertedSounds.push(soundName)
}
for (const entry of entries) {
const entryPath = join(folderPath, entry)
const stats = await fs.promises.stat(entryPath)

Check warning on line 19 in src/builtinCommands.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
const zipEntryPath = join(relativePath, entry)
if (stats.isDirectory()) {
const subZip = zip.folder(zipEntryPath)
await addFolderToZip(entryPath, subZip, zipEntryPath)

Check warning on line 25 in src/builtinCommands.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
} else {
const fileData = await fs.promises.readFile(entryPath)

Check warning on line 27 in src/builtinCommands.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
zip.file(entry, fileData)
}
}
// eslint-disable-next-line no-constant-condition
while (true) {
const { done, value } = await reader.read()

Check warning on line 44 in src/downloadAndOpenFile.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
if (done) {
controller.close()
let versionDetected = false
for (const [i, _] of Array.from({ length: 32 }).entries()) {
for (const [k, _] of Array.from({ length: 32 }).entries()) {
const nbt = await region.read(i, k)

Check warning on line 68 in src/dragndrop.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
chunks[`${i},${k}`] = nbt
if (nbt && !versionDetected) {
const simplified = simplifyNbt(nbt)
return elements[0].faces
}
const svSuToCoordinates = (path: string, u, v, su, sv = su) => {

Check warning on line 152 in src/inventoryWindows.ts

GitHub Actions / build-and-deploy

Arrow function has too many parameters (5). Maximum allowed is 4
const img = getImage({ path })!
if (!img.width) throw new Error(`Image ${path} is not loaded`)
return [u * img.width, v * img.height, su * img.width, sv * img.height]
lastWindow.pwindow.touch = miscUiState.currentTouch ?? false
const oldOnInventoryEvent = lastWindow.pwindow.onInventoryEvent.bind(lastWindow.pwindow)
lastWindow.pwindow.onInventoryEvent = (type, containing, windowIndex, inventoryIndex, item) => {

Check warning on line 501 in src/inventoryWindows.ts

GitHub Actions / build-and-deploy

Arrow function has too many parameters (5). Maximum allowed is 4
if (inv.canvasManager.children[0].currentGuide) {
const isRightClick = type === 'rightclick'
const isLeftClick = type === 'leftclick'
// improve compatibility with community saves
const rootRemapFiles = ['Warp files']
for (const rootRemapFile of rootRemapFiles) {
if (await existsViaStats(path.join(root, '..', rootRemapFile))) {

Check warning on line 163 in src/loadSave.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
forceRedirectPaths[path.join(root, rootRemapFile)] = path.join(root, '..', rootRemapFile)
}
}
await updateResourcePackSupportPanorama()
for (const file of panoramaFiles) {
panorMaterials.push(new THREE.MeshBasicMaterial({
map: loader.load(await possiblyLoadPanoramaFromResourcePack(file)),

Check warning on line 84 in src/panorama.ts

GitHub Actions / build-and-deploy

Unexpected `await` inside a loop
transparent: true,
side: THREE.DoubleSide
}))