message: core-api: memoize app element traversal and validation
diff: @@ -242,8 +242,8 @@ export class PrivateAppImpl implements BackstageApp {
  [],
  );
  - // Probably want to memo this?
  - const { routePaths, routeParents, routeObjects } = traverseElementTree({
  + const { routePaths, routeParents, routeObjects } = useMemo(() => {
  + const result = traverseElementTree({
  root: children,
  discoverers: [childDiscoverer, routeElementDiscoverer],
  collectors: {
  @@ -253,7 +253,10 @@ export class PrivateAppImpl implements BackstageApp {
  },
  });
  - validateRoutes(routePaths, routeParents);
  + validateRoutes(result.routePaths, result.routeParents);
  +
  + return result;
  + }, [children]);
  const loadedConfig = useConfigLoader(
  this.configLoader,
  