Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working version for Windows #15

Merged
merged 4 commits into from
Sep 25, 2018
Merged

Conversation

Ashafix
Copy link
Contributor

@Ashafix Ashafix commented Sep 25, 2018

Changes

  • __attribute__((visibility("default"))) was replaced to make non GNU compiler accept the file
  • in order to make it work on Windows fmemopen and open_memstream were replaced with Windows specific functions. CreateFileA should only create in-memory files unless the files become too big.
  • the biggest apparent change is due to if ((fin != NULL) && (fout != NULL)) became if ((fin == NULL) || (fout == NULL)) to get rid of one level of indentation and the else block. This doesn't change any of the code or logic.
  • whitespace: cleanup

Testing

  1. Ubuntu
  • Compiles and runs on Ubuntu 16.04 LTS with Python 2.7 and 3.5, no apparent change in the run time for the unit tests
  1. Windows 10
  • Python 2.5: using Microsoft Visual C++ Compiler for Python 2.7
  • Python 3.5: using Visual Studio 2015
  • Python 3.7: using Visual Studio 2015

Run times

  1. Ubuntu laptop (i5-2520M, 2.50 GHz)
  • Python 2.7: ~20 msec for 24 tests
  • Python 3.5: ~25 msec for 24 tests
  1. Windows (i5-2500, 3.30 GHz)
  • Python 2.7: ~125 msec for 24 tests
  • Python 3.5: ~120 msec for 24 tests
  • Python 3.7: ~120 msec for 24 tests

Tests were run with python -m unittest discover

@shyuep shyuep merged commit 2d3fd3a into materialsvirtuallab:master Sep 25, 2018
@shyuep
Copy link
Contributor

shyuep commented Sep 25, 2018

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants