Performance improvements

This commit is contained in:
Pieter Vander Vennet 2021-02-05 16:32:37 +01:00
parent 49f78d5604
commit 8f8ef690a4
11 changed files with 125 additions and 101 deletions

View file

@ -16,7 +16,7 @@ export class ElementStorage {
}
addElement(element): UIEventSource<any> {
const eventSource = new UIEventSource<any>(element.properties);
const eventSource = new UIEventSource<any>(element.properties, "tags of "+element.properties.id);
this._elements[element.properties.id] = eventSource;
return eventSource;
}

View file

@ -69,7 +69,7 @@ export class OsmConnection {
}
this.userDetails = new UIEventSource<UserDetails>(new UserDetails());
this.userDetails = new UIEventSource<UserDetails>(new UserDetails(), "userDetails");
this.userDetails.data.dryRun = dryRun;
this._dryRun = dryRun;

View file

@ -13,7 +13,7 @@ export class UIEventSource<T> {
return [];
}
// @ts-ignore
window.mcperf = () => {
window.mapcomplete_performance = () => {
console.log(UIEventSource.allSources.length, "uieventsources created");
const copy = [...UIEventSource.allSources];
copy.sort((a,b) => b._callbacks.length - a._callbacks.length);