chore: some updates
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m58s
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m58s
This commit is contained in:
@@ -610,9 +610,6 @@ export class GraphManager extends EventEmitter<{
|
||||
return s.accepts?.find(a => nodeType.outputs?.includes(a))
|
||||
}))
|
||||
|
||||
console.log(definitions.map(d => Object.values(d?.inputs ?? {})))
|
||||
console.log(definitions)
|
||||
|
||||
return definitions
|
||||
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export class MemoryRuntimeExecutor implements RuntimeExecutor {
|
||||
|
||||
constructor(
|
||||
private registry: NodeRegistry,
|
||||
private cache?: SyncCache<Int32Array>,
|
||||
// private cache?: SyncCache<Int32Array>,
|
||||
) { }
|
||||
|
||||
private async getNodeDefinitions(graph: Graph) {
|
||||
|
||||
@@ -2,12 +2,11 @@ import { MemoryRuntimeExecutor } from "./runtime-executor";
|
||||
import { RemoteNodeRegistry, IndexDBCache } from "@nodarium/registry";
|
||||
import type { Graph } from "@nodarium/types";
|
||||
import { createPerformanceStore } from "@nodarium/utils";
|
||||
import { MemoryRuntimeCache } from "./runtime-executor-cache";
|
||||
|
||||
const cache = new MemoryRuntimeCache();
|
||||
const indexDbCache = new IndexDBCache("node-registry");
|
||||
const nodeRegistry = new RemoteNodeRegistry("", indexDbCache);
|
||||
const executor = new MemoryRuntimeExecutor(nodeRegistry, cache);
|
||||
|
||||
const executor = new MemoryRuntimeExecutor(nodeRegistry);
|
||||
|
||||
const performanceStore = createPerformanceStore();
|
||||
executor.perf = performanceStore;
|
||||
|
||||
@@ -82,6 +82,11 @@ export const AppSettingTypes = {
|
||||
label: "Show Stem Lines",
|
||||
value: false,
|
||||
},
|
||||
showGraphJson: {
|
||||
type: "boolean",
|
||||
label: "Show Graph Source",
|
||||
value: false,
|
||||
},
|
||||
stressTest: {
|
||||
title: "Stress Test",
|
||||
amount: {
|
||||
|
||||
20
app/src/lib/sidebar/panels/GraphSource.svelte
Normal file
20
app/src/lib/sidebar/panels/GraphSource.svelte
Normal file
@@ -0,0 +1,20 @@
|
||||
<script lang="ts">
|
||||
import type { Graph } from "$lib/types";
|
||||
|
||||
const { graph }: { graph: Graph } = $props();
|
||||
|
||||
function convert(g: Graph): string {
|
||||
return JSON.stringify(
|
||||
{
|
||||
...g,
|
||||
nodes: g.nodes.map((n: any) => ({ ...n, tmp: undefined })),
|
||||
},
|
||||
null,
|
||||
2,
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<pre>
|
||||
{convert(graph)}
|
||||
</pre>
|
||||
@@ -27,6 +27,7 @@
|
||||
import { createPerformanceStore } from "@nodarium/utils";
|
||||
import BenchmarkPanel from "$lib/sidebar/panels/BenchmarkPanel.svelte";
|
||||
import { debounceAsyncFunction } from "$lib/helpers";
|
||||
import GraphSource from "$lib/sidebar/panels/GraphSource.svelte";
|
||||
|
||||
let performanceStore = createPerformanceStore();
|
||||
|
||||
@@ -88,16 +89,13 @@
|
||||
});
|
||||
|
||||
let runIndex = 0;
|
||||
const handleUpdate = debounceAsyncFunction(
|
||||
async (g: Graph, s: Record<string, any> = graphSettings) => {
|
||||
|
||||
async function update(g: Graph, s: Record<string, any> = graphSettings) {
|
||||
runIndex++;
|
||||
performanceStore.startRun();
|
||||
try {
|
||||
let a = performance.now();
|
||||
const graphResult = await runtime.execute(
|
||||
$state.snapshot(g),
|
||||
$state.snapshot(s),
|
||||
);
|
||||
const graphResult = await runtime.execute(g, s);
|
||||
let b = performance.now();
|
||||
|
||||
if (appSettings.value.debug.useWorker) {
|
||||
@@ -119,8 +117,9 @@
|
||||
} finally {
|
||||
performanceStore.stopRun();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const handleUpdate = debounceAsyncFunction(update);
|
||||
|
||||
$effect(() => {
|
||||
//@ts-ignore
|
||||
@@ -220,6 +219,14 @@
|
||||
<PerformanceViewer data={$performanceStore} />
|
||||
{/if}
|
||||
</Panel>
|
||||
<Panel
|
||||
id="graph-source"
|
||||
title="Graph Source"
|
||||
hidden={!appSettings.value.debug.showGraphJson}
|
||||
icon="i-tabler-code"
|
||||
>
|
||||
<GraphSource {graph} />
|
||||
</Panel>
|
||||
<Panel
|
||||
id="benchmark"
|
||||
title="Benchmark"
|
||||
|
||||
Reference in New Issue
Block a user