Skip to content

Commit

Permalink
Merge pull request #164 from ndsev/performance-improvements
Browse files Browse the repository at this point in the history
Release 2024.4.1
  • Loading branch information
josephbirkner authored Nov 6, 2024
2 parents a4d9749 + c1ea3bc commit 471f78c
Show file tree
Hide file tree
Showing 37 changed files with 2,847 additions and 1,802 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* text=auto

# Explicitly list (some) binary exts
# to avoid false positive text detection
*.png binary
*.jpg binary
*.ico binary
*.glb binary
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '21.x'
node-version: '22.x'
cache: "npm"
cache-dependency-path: package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ message("Building for ${CMAKE_SYSTEM_NAME}.")

FetchContent_Declare(mapget
GIT_REPOSITORY "https://github.com/Klebert-Engineering/mapget"
GIT_TAG "v2024.4.0"
GIT_TAG "v2024.4.1"
GIT_SHALLOW ON)
FetchContent_MakeAvailable(mapget)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.4.0
2024.4.1
1 change: 1 addition & 0 deletions erdblick_app/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {filter} from "rxjs";
<inspection-panel></inspection-panel>
<pref-components></pref-components>
<coordinates-panel></coordinates-panel>
<stats-dialog></stats-dialog>
<div id="info">
{{ title }} {{ version }}
</div>
Expand Down
10 changes: 9 additions & 1 deletion erdblick_app/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ import {ReactiveFormsModule} from '@angular/forms';
import {FormlyPrimeNGModule} from "@ngx-formly/primeng";
import {DataSourcesService} from "./datasources.service";
import {ProgressSpinnerModule} from "primeng/progressspinner";
import {StatsDialogComponent} from "./stats.component";
import {SourceDataLayerSelectionDialogComponent} from "./sourcedataselection.dialog.component";
import {ContextMenuModule} from "primeng/contextmenu";
import {RightClickMenuService} from "./rightclickmenu.service";

export function initializeServices(styleService: StyleService, mapService: MapService, coordService: CoordinatesService) {
return async () => {
Expand Down Expand Up @@ -147,6 +151,8 @@ export function typeValidationMessage({ schemaType }: any) {
MultiSchemaTypeComponent,
HighlightSearch,
TreeTableFilterPatchDirective,
StatsDialogComponent,
SourceDataLayerSelectionDialogComponent
],
bootstrap: [
AppComponent
Expand Down Expand Up @@ -213,7 +219,8 @@ export function typeValidationMessage({ schemaType }: any) {
{name: 'multischema', component: MultiSchemaTypeComponent}
],
}),
ProgressSpinnerModule
ProgressSpinnerModule,
ContextMenuModule
],
providers: [
{
Expand All @@ -233,6 +240,7 @@ export function typeValidationMessage({ schemaType }: any) {
ClipboardService,
EditorService,
DataSourcesService,
RightClickMenuService,
provideHttpClient()
]
})
Expand Down
10 changes: 10 additions & 0 deletions erdblick_app/app/cesium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ export type Matrix3 = Cesium.Matrix3;
export const Matrix3 = Cesium.Matrix3;
export type Color = Cesium.Color;
export const Color = Cesium.Color;
export type GeometryInstance = Cesium.GeometryInstance;
export const GeometryInstance = Cesium.GeometryInstance;
export type PerInstanceColorAppearance = Cesium.PerInstanceColorAppearance;
export const PerInstanceColorAppearance = Cesium.PerInstanceColorAppearance;
export type Primitive = Cesium.Primitive;
export const Primitive = Cesium.Primitive;
export type RectangleGeometry = Cesium.RectangleGeometry;
export const RectangleGeometry = Cesium.RectangleGeometry;
export type RectangleOutlineGeometry = Cesium.RectangleOutlineGeometry;
export const RectangleOutlineGeometry = Cesium.RectangleOutlineGeometry;
export type ColorGeometryInstanceAttribute = Cesium.ColorGeometryInstanceAttribute;
export const ColorGeometryInstanceAttribute = Cesium.ColorGeometryInstanceAttribute;
export type ImageryLayer = Cesium.ImageryLayer;
Expand Down
1 change: 0 additions & 1 deletion erdblick_app/app/datasources.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ export class DatasourcesComponent {
}

closeEditorDialog(event: any) {
console.log(event);
if (this.editorDialog !== undefined) {
if (this.wasModified) {
event.stopPropagation();
Expand Down
2 changes: 1 addition & 1 deletion erdblick_app/app/datasources.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class DataSourcesService {
this.messageService.showSuccess(data.body);
setTimeout(() => {
this.loading = false;
this.mapService.reloadDataSources().then(_ => this.mapService.update());
this.mapService.reloadDataSources().then(_ => this.mapService.update().then());
}, 2000);
},
error: error => {
Expand Down
32 changes: 19 additions & 13 deletions erdblick_app/app/feature.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {coreLib} from "./wasm";
import {ClipboardService} from "./clipboard.service";
import {TreeTable} from "primeng/treetable";
import {ParametersService} from "./parameters.service";
import {InfoMessageService} from "./info.service";

interface Column {
field: string;
Expand Down Expand Up @@ -193,6 +194,7 @@ export class FeaturePanelComponent implements OnInit, AfterViewInit, OnDestroy
public jumpService: JumpTargetService,
public parameterService: ParametersService,
private renderer: Renderer2,
private messageService: InfoMessageService,
public mapService: MapService) {
this.inspectionService.featureTree.pipe(distinctUntilChanged()).subscribe((tree: string) => {
this.jsonTree = tree;
Expand Down Expand Up @@ -360,19 +362,23 @@ export class FeaturePanelComponent implements OnInit, AfterViewInit, OnDestroy
showSourceData(event: any, sourceDataRef: any) {
event.stopPropagation();

const layerId = sourceDataRef.layerId;
const tileId = sourceDataRef.tileId;
const address = sourceDataRef.address;
const mapId = this.inspectionService.selectedFeatures[0].featureTile.mapName;
const featureIds = this.inspectionService.selectedFeatures.map(f=>f.featureId).join(", ");

this.inspectionService.selectedSourceData.next({
tileId: Number(tileId),
layerId: String(layerId),
mapId: String(mapId),
address: BigInt(address),
featureIds: featureIds,
})
try {
const layerId = sourceDataRef.layerId;
const tileId = sourceDataRef.tileId;
const address = sourceDataRef.address;
const mapId = this.inspectionService.selectedFeatures[0].featureTile.mapName;
const featureIds = this.inspectionService.selectedFeatures.map(f => f.featureId).join(", ");

this.inspectionService.selectedSourceData.next({
tileId: Number(tileId),
layerId: String(layerId),
mapId: String(mapId),
address: BigInt(address),
featureIds: featureIds,
})
} catch (e) {
this.messageService.showError(`Encountered error: ${e}`);
}
}

onValueClick(event: any, rowData: any) {
Expand Down
17 changes: 16 additions & 1 deletion erdblick_app/app/features.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ export class FeatureTile {
preventCulling: boolean;
public readonly tileFeatureLayerBlob: any;
disposed: boolean;
stats: Map<string, number[]> = new Map<string, number[]>();

static statTileSize = "tile-size-kb";
static statParseTime = "parse-time-ms";

/**
* Construct a FeatureTile object.
* @param parser Singleton TileLayerStream WASM object.
* @param tileFeatureLayerBlob Serialized TileFeatureLayer.
* @param preventCulling Set to true to prevent the tile from being removed when it isn't visible.
*/
constructor(parser: TileLayerParser, tileFeatureLayerBlob: any, preventCulling: boolean) {
constructor(parser: TileLayerParser, tileFeatureLayerBlob: Uint8Array, preventCulling: boolean) {
let mapTileMetadata = uint8ArrayToWasm((wasmBlob: any) => {
return parser.readTileLayerMetadata(wasmBlob);
}, tileFeatureLayerBlob);
Expand All @@ -36,6 +40,11 @@ export class FeatureTile {
this.layerName = mapTileMetadata.layerName;
this.tileId = mapTileMetadata.tileId;
this.numFeatures = mapTileMetadata.numFeatures;
this.stats.set(FeatureTile.statTileSize, [tileFeatureLayerBlob.length/1024]);
for (let [k, v] of Object.entries(mapTileMetadata.scalarFields)) {
this.stats.set(k, [v as number]);
}
this.stats.set(FeatureTile.statParseTime, []);
this.parser = parser;
this.preventCulling = preventCulling;
this.tileFeatureLayerBlob = tileFeatureLayerBlob;
Expand All @@ -50,9 +59,12 @@ export class FeatureTile {
peek(callback: (layer: TileFeatureLayer) => any) {
// Deserialize the WASM tileFeatureLayer from the blob.
let result = uint8ArrayToWasm((bufferToRead: any) => {
let startTime = performance.now();
let deserializedLayer = this.parser.readTileFeatureLayer(bufferToRead);
let endTime = performance.now();
if (!deserializedLayer)
return null;
this.stats.get(FeatureTile.statParseTime)!.push(endTime - startTime);

// Run the callback with the deserialized layer, and
// provide the result as the return value.
Expand All @@ -72,9 +84,12 @@ export class FeatureTile {
async peekAsync(callback: (layer: TileFeatureLayer) => Promise<any>) {
// Deserialize the WASM tileFeatureLayer from the blob.
let result = await uint8ArrayToWasmAsync(async (bufferToRead: any) => {
let startTime = performance.now();
let deserializedLayer = this.parser.readTileFeatureLayer(bufferToRead);
let endTime = performance.now();
if (!deserializedLayer)
return null;
this.stats.get(FeatureTile.statParseTime)!.push(endTime - startTime);

// Run the callback with the deserialized layer, and
// provide the result as the return value.
Expand Down
Loading

0 comments on commit 471f78c

Please sign in to comment.