2,621 karma · joined Oct 16, 2012 (14y ago) · 233 submissions
comment 10y ago · link · parent
The "size" command gives a more accurate measurement of what actually ends up in a compiled and stripped binary. "ls -l" includes symbolic and linking info that gets stripped from the finished binary.
comment 10y ago · link · parent
Thanks for the suggestion. I just checked in an enhancements so that this works now. https://www.fossil-scm.org/fossil/info/c46f98055cf49687
As for your other short-comings, please mention them on the fossil-users@lists.fossil-scm.org mailing list
comment 10y ago · link · parent
If you accidentally check-in proprietary or sensitive content that you didn't mean to publish, you can shun that content. Shunning leaves a hole in your history. There is no way to replace that hole with different content.
comment 10y ago · link · parent
Where Tcl to die, SQLite would die with it. Fortunately, both outcomes seem unlikely.
Some of us are old enough to remember the frequent prognostications that "unix is dead" and was being replaced by more modern OSes like VMS or OS/2. How'd that work out?
comment 11y ago · link · parent
Lemon was intended as a yacc-replacement. The advantages of lemon over yacc are that lemon has a less error-prone syntax (it uses symbolic names rather than $1, $2, etc), and that lemon generates a reentrant and thread-safe parser. (At the time, yacc/bison parsers were neither reentrant nor thread-safe. I don't know if that has been fixed in the intervening decades.)
Lemon has always been open source. But it languished with little attention for 10 years until I used it to generate the parser for SQLite. Then suddenly people started to notice and use it.
Lemon does not have a separate version control system. The source code to Lemon (a single file of C plus a template file for the generated parser) are part of the SQLite source tree.
comment 11y ago · link · parent
(2) SQLite's printf includes extensions like %q and %Q that help prevent SQL injection attacks. These are used internally. (grep for '%q' and '%Q' in the SQLite sources and see for yourself.)
(3) Nothing like sqlite3_mprintf() is available from standard libraries. And yet it is a very useful and important interface.
(4) SQLite has a printf() SQL function for formatting text. I don't know of any way to build that using a standard-library printf() implementation - you need to have direct access to the printf() source code to make it work from SQL.
(5) Library printf() implementations are often subject to LOCALE, which means that if "3.14159" is render as "3,14159" (as it is for some LOCALEs) it will break SQL syntax rules when used to construct an SQL statement.
I can probably think of other reasons, but those are the ones that come quickly to mind.
comment 11y ago · link · parent
It is far, far better to send us a test case. The smaller the test case, the better, but any test case will do. We are much freer to accept test cases without copyright complications, and test cases have to be written anyhow before any changes are checked in. So just send in a test case and let us find and fix the bug for you. If it is a crash bug, it is usually fixed quickly - within hours.
lcamtuf always sent us succinct test cases. Never patches.
comment 11y ago · link · parent
I think many people have trouble with TCL because it looks a lot like C and so they expect it to behave roughly like C. But TCL is a fundamentally different language. It is better to think of TCL as LISP with C-like syntax. Once you grok this difference, TCL becomes a very elegant language.
comment 11y ago · link · parent
Please check back in a few weeks.
If you would like to leave comments describing the kinds of problems you would like JSON support in SQLite to solve, I promise to read them all and give them careful consideration.
comment 11y ago · link · parent
The sqllogictest suite takes about 15 minutes to run three times against SQLite (once with all optimizations turned on, and twice more with various optimizations turned off) on a fast machine.
comment 11y ago · link · parent
To run all of the tests under various compile-time options and on all supported platforms usually takes two to three days, assuming everything works. A full-up automated test on just Linux x64 takes about 18 hours.
comment 11y ago · link · parent
comment 11y ago · link · parent
comment 12y ago · link · parent
Also, the cg_annotate utility gives me a complete program listing showing me the cycle counts spent on each line of code, which is invaluable in tracking down hotspots in need of work. If perf provides such a tool, I am unaware of it.
Remember that I'm not trying to optimize for a specific CPU. SQLite is cross-platform. I want to do optimizations that help on all CPUs using all compilers. I'm measuring the performance on the "cachegrind virtual CPU" of a binary prepared using GCC and -Os because that combination gives repeatable measurements that are easy to map into specific lines of source code. But the optimizations themselves should usually apply across all CPUs and all compilers and all compiler optimization settings.
Nkruz is, of course, welcomed to use any tool he likes to optimize his projects. But, at least for the moment, I'm finding cachegrind to be a better tool to help with implementing micro-optimizations.
comment 12y ago · link · parent
So, if you have two file descriptors open on the same file in the same process, a lock on one file descriptor is unable to control access to the file from the second file descriptor. POSIX locks only work if the two file descriptors are in separate processes.
There is a large of code in SQLite that works around this bug. And that code works well. But that code requies access to global variables.
The problem that Eric describes comes up when you link in two separate copies of SQLite, and thus have two distinct sets of global variables for managing the locks. These two separate copies of SQLite have no why of knowing about each other, and hence have no way of coordinating their lock behavior in order to avoid problems.
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 14y ago · link · parent
The VM used by SQLite is different from the VM used by things like Javascript or Python in that SQL is not a general-purpose programming language. Most of the opcodes in the SQLite VM are heavy-weight concepts such as "insert a key/value pair into a b-tree" or "decode the N-th column of a table row". These opcodes are implemented with hundreds or thousands of lines of C code. The overhead of instruction dispatch is insignificant in comparison. And so there isn't much of a performance advantage one way or the other between a stack machine and a register machine in SQLite. The choice of a register machine is for maintainability, reliability, and testability.