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

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

Categories

HOME
adal
webdriver
yahoo-finance
camera
shiro
vscode-extensions
edge
spring-data-mongodb
parameters
opengl-es-3.0
mongodb-csharp
intershop
xmonad
symfony-console
connector
microsoft-ocr
guzzle
exploit
tosca
beta
vex
constexpr
boost-asio
complex-numbers
left-join
login-script
joomla2.5
sql-delete
roblox
graphhopper
timing
azure-arm
trigonometry
plaintext
parser-generator
subclipse
install.packages
glm-math
uiimage
rfc3339
facebook-social-plugins
fwrite
ovf
openrasta
podscms
git-flow
choice
materialized-path-pattern
redbeard-ios
seek
mta
installshield-2010
dimension
project-organization
sklearn-pandas
lz77
pushbots
phpgrid
poppler
video-player
wso2greg
dnssec
j-security-check
public-html
infosphere-spl
at-job
cosine-similarity
uncaught-typeerror
android-vibration
addressing-mode
sonarqube-5.0
punycode
jquery-slider
radiant
model-driven-development
dolby-audio-api
diem
joomla-template
windows-98
device-width
cross-database
cgimage
jquery-address
pylucene
timthumb
codebase
globals
purepdf
lobo-cobra
cldc
int64

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