Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format of annotation layers #180

Open
eroux opened this issue Aug 10, 2022 · 1 comment
Open

format of annotation layers #180

eroux opened this issue Aug 10, 2022 · 1 comment
Assignees
Labels

Comments

@eroux
Copy link
Contributor

eroux commented Aug 10, 2022

currently inside a layer annotations are stored in an object:

id: 32256a98594543a8b5a5013af8cab7f9
annotation_type: Pagination
revision: '00001'
annotations:
  81a6c8d478834c8c994189ef50e8865a:
    imgnum: 1
    reference: I1PD1088170001.tif
    span:
      start: 0
      end: 629

which may have some benefits, but I think it has a huge issues: objects are not sorted so if you want to return annotations in order for just a range of characters (which I suspect is a fairly common use case), you have to read all the annotations, sort them by spans, and then filter the results by number of characters. That's a huge performance issue, I suspect this might impact the UI of the editor as well

@10zinten 10zinten self-assigned this Aug 11, 2022
@10zinten
Copy link
Collaborator

@eroux right, but for annotation lookup operation with annotation id, then we need to linear search over all the annotations. Anyway this is much less expensive than sorting and filtering.

sure, I will refactor to store annotations into list with order of span.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants