metaprogramming


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.

Related Links

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
Elixir: eval'ing code in module context using Code.eval_quoted/3
What is Declarative Meta-Programming?
Reconsolidate protocols in Elixir 1.2 or higher
Inserting an AST into a quote do end block without unquoting it
Transform quoted elixir code to a code string
Pattern matching benchmarking : Compiletime lookup vs Runtime lookup in D
Meta construction capabilities?
How to manipulate the value of variables based on an array of symbols in Julia?
Multiple #:build macros
Julia automatically generate functions and export them
Dealing with end keyword in macros for array indices

Categories

HOME
sonarqube
merge
rdbms
angular-formly
solaris
package
error-handling
access
cublas
switch-statement
google-apps
3d-reconstruction
jetty
polling
webix
owin
vimdiff
mod-security
favicon
gource
libusb
parameter-passing
event-sourcing
google-content-api
blade
question2answer
dataflow-diagram
custom-post-type
corpus
flooding
progress-bar
inversion-of-control
mobx
scatter3d
left-join
sql-server-2000
angularjs-material
mailkit
sammy.js
gnat-gps
vue-chartjs
installscript
numpy-broadcasting
swagger-php
git-rewrite-history
placeholder
android-checkbox
chai-as-promised
datamaps
lightning
corruption
stdmap
oracleclient
opengl-4
headless
reshape
cmp
android-instrumentation
renaming
cvxpy
gets
smartfoxserver
cronexpression
chromium-os
flex-monkey
ziparchive
seek
async.js
iotivity
delta
observablecollection
angular-ui-typeahead
project-organization
hadoop-partitioning
database-relations
qbxml
crouton-os
pypiserver
lazybones
intel-c++
dot.js
ejb-2.x
filesplitting
tweenlite
trdion2011
jqmodal
named-parameters
websphere-esb
getopt
windows-embedded-standard
eclipse-kepler
gtm-oauth2
embedded-fonts
kendo-dataviz
isqlquery
modular
rolify
neos-server
route-provider
cascadingdropdown
pdfviewer
fragmenttransaction
vfs
zope.interface
saleslogix
rmiregistry
boost-signals
extconf.rb
objectquery
gobject-introspection
denied
expression-blend-4
screen-size
cuteeditor
diagrams
blender-2.49
tui
escrow
flvplayback
technical-debt
lemmatization

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App