Pattern matching benchmarking : Compiletime lookup vs Runtime lookup in D
I need advice on my first D-project . I have uploaded it at :- https://bitbucket.org/mrjohns/matcher/downloads IDEA : Benchmarking of 3 runtime algorithms and comparing them to their compile-time variants. The only difference between these is that for the compile time-ones, the lookup tables (i.e. Arrays bmBc, bmGs, and suffixes ) must be computed at compile time( I currently rely on CTFE ) . While for the runtime-ones the lookup tables are computed on runtime. NB : The pattern matching algorithms themselves need not be executed at compile-time, only the lookup tables.Having stated this the algorithms which run on known( compile-time computed) tables must be faster than the ones which have to compute them at runtime. My results seem to show something different, only the first pair( BM_Runtime and BM_Compile-time) yields admissible results, the other two pair give higher execution time for the compile-time variants. I think am missing something here. Please help. Current Results for the pattern="GCAGAGAG" are as below :- **BM_Runtime** = 366 hnsecs position= 513 **BM_Compile-time** = 294 hnsecs position =513 **BMH_Runtime** = 174 hnsecs position= 513 **BMH_Compile-time** = 261 hnsecs position= 513 **AG_Run-time** = 258 hnsecs position= 513 **AG_Compile-time** = 268 hnsecs position= 513 Running the code : dmd -J. matcher.d inputs.d rtime_pre.d ctime_pre.d && numactl --physcpubind=0 ./matcher I would appreciate your suggestions. Thanking you in advince.
Any performance test without activating compiler optimization is not useful. You should add dmd -release -inline -O -boundscheck=off. Also usually performance tests use cycles for repeating calculations. Otherwise you may get incorrect results.
System of equations using metaprogramming
How to define a partial copy constructor metaprogramically in Julia?
How to interpolate into a Julia “for” expression?
Sending a keyword list to a macro and using bind_quoted
Runtime meta programming in ceylon
Is there a fast way of going from a symbol to a function call in Julia? [duplicate]
Programmatically alter Elixir Code
Elixir - How can I unquote an array of functions in my macro?
Nim reflect on type's field types at compile-time
Save variables to file at runtime
In Julia, is it possible to pass values for evaluation in an Expr object without using global variables?
Metaprogramming in Julia — Splice integer into variable name
What's the difference between `use` and `#before_compile`?
How to define functions based on attribute to elixir?
Remove a const qualifier from a variable in D
Meta-modeling crud FROM/JOIN/WHERE statement fragments for higher-level analysis