Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2940

Re: Improved accuracy in diagnostics. Is it worthwhile?

From Thomas Koenig <tkoenig@netcologne.de>
Newsgroups comp.compilers
Subject Re: Improved accuracy in diagnostics. Is it worthwhile?
Date 2022-03-18 18:12 +0000
Organization news.netcologne.de
Message-ID <22-03-038@comp.compilers> (permalink)
References <22-03-035@comp.compilers>

Show all headers | View raw


Ev. Drikos <drikosev@gmail.com> schrieb:

> This is mainly a parsing question but it's also Fortran related as well.

[...]

> So far, my approach has been that improved diagnostics shouldn't slow
> down the processing of correct programs.

With today's computer speeds, this is likely not a very important
consideration any more.

If you are compiling, it is usually a small fraction of time that
is spent in the parsing, and much more in optimization and code
generation.  An example: Compiling a 50 k line Fortran program with
"gfortran -O2" takes 17.4 seconds on the computer I type this on.
Checking with "gfortran -fsyntax-only" takes 4.2 seconds.  (For
those who want to reproduce: aermod.f90 from the Polyhedron suite).

50k lines for a single source files is already quite a lot (much
longer than most source files for modular programs are likely to
be) and throwing a bit more CPU time at the problem to reduce user
confusion by emitting better error messages is extremely likely
to be a win for the user.  Just be careful to avoid anything
worse than O(n log n) for code size, or somebody will come
along with a test case that takes _really_ long.

(Take the above with a grain of salt for C++ headers.)


> Is it worthwhile to improve
> diagnostics by disabling default actions in a LALR parser?

I would presume so.  Run a few benchmarks and find out.
[In my experience, lexing and optimization take most of the
time, and parsing is insignificant. -John]

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Improved accuracy in diagnostics. Is it worthwhile? "Ev. Drikos" <drikosev@gmail.com> - 2022-03-18 07:25 +0200
  Re: Improved accuracy in diagnostics. Is it worthwhile? Kaz Kylheku <480-992-1380@kylheku.com> - 2022-03-18 16:47 +0000
  Re: Improved accuracy in diagnostics. Is it worthwhile? Thomas Koenig <tkoenig@netcologne.de> - 2022-03-18 18:12 +0000
    Re: Improved accuracy in diagnostics. Is it worthwhile? "Ev. Drikos" <drikosev@gmail.com> - 2022-03-19 19:58 +0200

csiph-web