digitalmars.D.announce - sqlite-statement CTFE Generation (UniformAccess) / Benchmark
- Robert Schadek (9/9) Apr 15 2014 Lately I had to write some sqlite3 code in D. And I really hated writing
- Dicebot (10/23) Apr 15 2014 Some quick observations:
- Robert Schadek (4/11) Apr 15 2014 will check
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (24/33) Apr 15 2014 Here is my non-technical input. :) Typos:
- Robert BuRnEr Schadek (1/24) Apr 15 2014 thank you
Lately I had to write some sqlite3 code in D. And I really hated writing it. So I wrote me some CTFE generator for it. It uses all the fun UDA, CTFE string mixin template magic, we all love. The generated code is as fast as the hand written one. I wrote some of it down. http://rburners.tumblr.com/ The article also holds a link to the source/benchmark. Maybe this is to some interest to other people as well. Best Regards Robert p.s. PRs and corrections welcome
Apr 15 2014
On Tuesday, 15 April 2014 at 15:57:13 UTC, Robert Schadek wrote:Lately I had to write some sqlite3 code in D. And I really hated writing it. So I wrote me some CTFE generator for it. It uses all the fun UDA, CTFE string mixin template magic, we all love. The generated code is as fast as the hand written one. I wrote some of it down. http://rburners.tumblr.com/ The article also holds a link to the source/benchmark. Maybe this is to some interest to other people as well. Best Regards Robert p.s. PRs and corrections welcomeSome quick observations: 1) toStringz(insertStmt) -> as inserStmt is actually a string literal, no need to use toStringz, literals are alway null-terminated. 2) in block immediately after `throw` has extra level of indentation 3) excessive sqlite3_finalize(stmt), one from first scope(exit) should have been enough Will read actual article a bit later :P
Apr 15 2014
On 04/15/2014 07:05 PM, Dicebot wrote:Some quick observations: 1) toStringz(insertStmt) -> as inserStmt is actually a string literal, no need to use toStringz, literals are alway null-terminated.did not know that. Thanks2) in block immediately after `throw` has extra level of indentationwill check3) excessive sqlite3_finalize(stmt), one from first scope(exit) should have been enoughwill checkWill read actual article a bit later :P
Apr 15 2014
On 04/15/2014 08:51 AM, Robert Schadek wrote:Lately I had to write some sqlite3 code in D. And I really hated writing it. So I wrote me some CTFE generator for it. It uses all the fun UDA, CTFE string mixin template magic, we all love. The generated code is as fast as the hand written one. I wrote some of it down. http://rburners.tumblr.com/ The article also holds a link to the source/benchmark. Maybe this is to some interest to other people as well. Best Regards Robert p.s. PRs and corrections welcomeHere is my non-technical input. :) Typos: snipped -> snippet (Also, there shouldn't be any comma in that sentence.) simular -> similar Than it -> Then it by a -> by an (not sure about that one) an decleration -> a declaration associcated -> associate all it UDAs -> all its UDAs table creating -> table create iteratable -> iterable not to difficult as well -> not too difficult either I wound -> I won't C++ Version -> C++ version I test dmd -> I tested dmd datebase -> database feel to create -> feel free to create request to for -> request for it seams, that most time -> it seems that most of the time spend -> spent ldc, because -> ldc because joins seam -> joins seem Become SQL -> Make SQL Ali
Apr 15 2014
Here is my non-technical input. :) Typos: snipped -> snippet (Also, there shouldn't be any comma in that sentence.) simular -> similar Than it -> Then it by a -> by an (not sure about that one) an decleration -> a declaration associcated -> associate all it UDAs -> all its UDAs table creating -> table create iteratable -> iterable not to difficult as well -> not too difficult either I wound -> I won't C++ Version -> C++ version I test dmd -> I tested dmd datebase -> database feel to create -> feel free to create request to for -> request for it seams, that most time -> it seems that most of the time spend -> spent ldc, because -> ldc because joins seam -> joins seem Become SQL -> Make SQL Alithank you
Apr 15 2014