jesusfv/Comparison-Programming-Languages-Economics
关于
A Comparison of Programming Languages in Economics
编程语言与运行时实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Comparison of Programming Languages in Economics
This project contains the source code referenced in the paper A Comparison of Programming Languages in Economics by S. Borağan Aruoba and Jesús Fernández-Villaverde.
The main fork will remain basically unchanged to allow researchers to check our basic results.
Abstract from the paper
We solve the stochastic neoclassical growth model, the workhorse of modern macroeconomics, using
C++11,Fortran 2008,Java,Julia,Python,Matlab,Mathematica, andR. We implement the same algorithm, value function iteration with grid search, in each of the languages. We report the execution times of the codes in aMacand in aWindowscomputer and comment on the strength and weakness of each language.
Files
RBC_C.c: C code.RBC_CPP.cpp: C++ codeRBC_CPP_2.cpp: C++ code, more idiomatic but slightly slower.RBC_F90.f90: Fortran code.RBC_Java.java: Java code.RBC_Julia.jl: Julia code, to runinclude("RBC_Julia.jl"); @time main().RBC_Matlab.m: Matlab code.RBC_Matlab_Inside_Loop.m: Matlab code with Mex file.inside_loop_mex.cpp: Mex file for 8.RBC_Python.py: Python code for CPython and Pypy.RBC_Python_Numba.py: Python code for Numba.RBC_R.R: R code.RBC_R_Compiler.R: R code compiled.RBC_Rcpp.R: R code with Rcpp.InsideLoop.cpp: C++ function for Rcpp.RBC_Mathematica: Mathematica code.RBC_Mathematica_Imperative: Mathematica code with imperative structure.RBC_Mathematica_PartialCompilation: Mathematica code with imperative structure and partial compilation.RBC_CS.cs: C# code.RBC_JS.js: Javascrip code.RBC_Python_Cython.py: Cython code.RBC_Swift.swift: Swift code.
Compilation flags
- GCC compiler (Mac):
g++ -o testc -O3 RBC_CPP.cpp - GCC compiler (Windows):
g++ -Wl,--stack,4000000, -o testc -O3 RBC_CPP.cpp - GCC compiler (Mac):
g++ -o testc -O3 -std=gnu++11 RBC_CPP_2.cpp - Clang compiler:
clang++ -o testclang -O3 RBC_CPP.cpp - Intel compiler:
icpc -o testc -O3 RBC_CPP.cpp - Visual C:
cl /F 4000000 /o testvcpp /O2 RBC_CPP.cpp - GCC compiler:
gfortran -o testf -O3 RBC_F90.f90 - Intel compiler:
ifortran -o testf -O3 RBC_F90.f90 javac RBC_Java.javaand run asjava RBC_Java -XX:+AggressiveOptsRBC_C.ccan be compiled in C, C++ and Objective-C:clang -o testc -x <language> -O3 RBC_C.cwith<language>=c,c++orobjective-c. Same for GCC.- Swift:
swiftc -o testswift -O RBC_Swift.swift -sdk $(xcrun --show-sdk-path --sdk macosx)
In all cases with a JIT, you may want to warm up the JIT before testing for speed.
探索相关项目
加载中…