From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada vs SQLite3 benchmark Date: Thu, 18 Sep 2014 22:08:50 +0200 Organization: cbb software GmbH Message-ID: References: <10k8o95prdhuj$.195flbmen5kex.dlg@40tude.net> <122qvkxwx9207$.x2ietmtp83wg$.dlg@40tude.net> <815a16a3-2393-4045-9e0a-3bb28123d26a@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: ZB2Fb2q1fa4xpMpNKFqV6Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:189054 Date: 2014-09-18T22:08:50+02:00 List-Id: On Thu, 18 Sep 2014 01:08:46 -0700 (PDT), briot.emmanuel@gmail.com wrote: > Why did you run the benchmarks without optimization ? That seems > inconsistent. If you are measuring performance, you should run with full > optimization on I think. Optimization could remove or rearrange parts of code which would not happen in a real-life case. For example doing something like for I in 1..1000 loop N := I; end loop; could be optimized to N := 1000. IMO, not optimized code is a better measure for algorithmic complexity. > Also, it would be interesting to use the following pragmas (combined or > not) in sqlite, since they can impact performance significantly: > pragma journal_mode=WAL; > pragma synchronous=OFF; (unless the Ada code is also running fsync() regularly) > > I think the latter in particular will significantly change the time measured for sqlite. Thanks for pointing this. Regarding Ada, it was strictly Ada.Direct_IO, nothing else. Ada.Direct_IO does not have Flush [*]. As far as I can tell GNAT's implementation of Ada.Direct_IO.Write is fwrite not followed by fsync. So forcing SQLite to sync might be unfair. However, the intended use surely must sync upon commit. ----------- * Maybe it is worth an AI to add Flush to Direct_IO. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de