Code Monkey home page Code Monkey logo

Comments (8)

spulec avatar spulec commented on July 17, 2024

If you get a chance, can you try the https://github.com/spulec/freezegun/tree/ctypes branch on App Engine? It will eventually become master for freezegun once I get the python 3 tests passing.

from freezegun.

spulec avatar spulec commented on July 17, 2024

Any chance that the latest release fixes any of this?

If not, I probably will close as wont-fix unless we can find something wrong with freezegun outside of GAE. I do appreciate you opening the ticket regardless. The fixes will be helpful to future users who search for this.

from freezegun.

reason-systems avatar reason-systems commented on July 17, 2024

Experienced the same kind of issue with GAE. The ctypes branch indeed solves the problem without requiring any monkey-patching.

from freezegun.

gsakkis avatar gsakkis commented on July 17, 2024

Also stumbled on this with GAE. Any chance that the ctypes branch is merged to master?

from freezegun.

spulec avatar spulec commented on July 17, 2024

Can you confirm that the most recent version doesn't work? If it doesn't work, what happens?

from freezegun.

gsakkis avatar gsakkis commented on July 17, 2024

This is weird.. when I tried the latest version from pypi a week ago it was behaving like a no-op; it was using the current datetime instead of the faked one. Now I tried it again and it works but there's a different problem: it's much slower than the ctypes version. For the same single test:

  • after pip install git+https://github.com/spulec/freezegun.git@ctypes

    real 0m0.982s
    user 0m0.826s
    sys 0m0.156s

  • after pip install freezegun==0.3.2

    real 0m17.678s
    user 0m16.077s
    sys 0m1.591s

Same observation with other tests too.

from freezegun.

spulec avatar spulec commented on July 17, 2024

Probably the same as #69

You could try an older version until that issue is resolved.

from freezegun.

gsakkis avatar gsakkis commented on July 17, 2024

After digging into it with the profiler, I isolated it to the import of six.moves:

$ python -m timeit "from freezegun import freeze_time; freeze_time('2012-01-14').start()"
1000 loops, best of 3: 1.85 msec per loop

$ python -m timeit "import six; from freezegun import freeze_time; freeze_time('2012-01-14').start()"
1000 loops, best of 3: 1.93 msec per loop

$ python -m timeit "import six.moves; from freezegun import freeze_time; freeze_time('2012-01-14').start()"
10 loops, best of 3: 301 msec per loop

from freezegun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.