We use HATEOAS for a great effect, however we look at performance and get very poor results from link building, namely code that looks like this
resource.add(linkTo(methodOn(SomeController.class).findAll())).withSelfRel());
Results (I'm not so worried about size, but recorded below)
Enabled links - ~438ms - 201 kb Disable links - ~193ms - 84.6 kb
The size is explained by the fact that we set 8 links to the resource, so we expect the size, but not the speed slows down.
Approximately 232 ms is spent building links of approximately 2 ms to the object I am returning (100 objects in this particular test)
Is there any way to speed this up? Can we get a preview of the URI for the whole request in a call toResources , and then use it in toResource ?
source share