emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Radio links work only in small numbers


From: Noboru Ota
Subject: Re: Radio links work only in small numbers
Date: Thu, 29 Feb 2024 17:47:07 +0100

Ihor Radchenko <yantar92@posteo.net> writes:
> Thanks for testing!
> Applied, onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=341a01a07
> Fixed.

You're very welcome. This is amazing. Thank you so much. I have rebased
the source to the latest main and also tested with 10,000 dummy entries.
The target links still work!

> See the docstring of `org-target-link-regexp-limit'. The hard limit is
> MAX_BUF_SIZE in src/regex-emacs.c, but that's after the regexp is
> compiled (AFAIU). So, the real limit is smaller and may depend on
> regexp complexity.

Thank you for the detail.

I do not need to understand all the technical detail here, but for
future reference and if you have the time, let me ask this -- please try
not to waste your time answering.

- MAX_BUF_SIZE in src/regex-emacs.c is, if I understand the comment
  around it correctly, 2^15 bytes = 32768 bytes.

- `org-target-link-regexp-limit` is 2^11 bytes = 2048 bytes (?).

- For my 5000 terms, (length org-target-link-regexp) => 103603 (what's
  the unit of measure?)

- (string-bytes org-target-link-regexp) => 103603, the same number.

- If I evaluate the following to try to get a compiled length of the
  regexp, 88785.

    (let ((regexp org-target-link-regexp))
        (with-temp-file "org-target-link-regexp"
          (insert regexp)))
    (byte-compile-file "org-target-link-regexp")
    (file-attribute-size (file-attributes "org-target-link-regexp.elc"))

- For 10000 dummy terms, (length org-target-link-regexp) => 228848.

The numbers I get seem to be much greater than 2048 (bytes?) and 32768
bytes....

My test with 10,000 terms is more than sufficient to cover my needs, so
please do not feel obliged to answer this technical part -- someone else
might want to jump in to help :)

– nobiot



reply via email to

[Prev in Thread] Current Thread [Next in Thread]