Coder Social home page Coder Social logo

Comments (7)

vstinner avatar vstinner commented on July 23, 2024

benchmark hangs

Do you mean that it uses all the CPU, or that the process hangs and do nothing?

Can you check which lines are executed when it "hangs"?

from cpython.

vstinner avatar vstinner commented on July 23, 2024

I reproduced the issue. The problem comes from _WindowsTime of distributed/metrics.py.

Combine time.time() or time.monotonic() with time.perf_counter() to get an absolute clock with fine resolution.

https://github.com/dask/distributed/blob/d5edb4e536c9acc4998f803aacc0dd0188af21ce/distributed/metrics.py#L45-L98

from cpython.

vstinner avatar vstinner commented on July 23, 2024

I reported the issue to the dask/distributed project and I proposed a fix:

from cpython.

vstinner avatar vstinner commented on July 23, 2024

@mdboom: I suggest to close this issue since it's not a bug in Python, and it's now tracked in dask/distributed.

from cpython.

mdboom avatar mdboom commented on July 23, 2024

I want to bring a discussion elsewhere back here.

@vstinner: I definitely have no experience with these Windows APIs, however, it seems that the change in 1d95451 introduced some stateful interaction between time.time and time.perf_counter, since they both now call py_win_perf_counter_frequency with the same global variable as base. Is this a regression for any code that calls time.time and time.perf_counter interleaved? What are the implications of that?

At a minimum, I think we should improve the "What's new" entry about this so people are aware of the interaction.

from cpython.

vstinner avatar vstinner commented on July 23, 2024

the change in 1d95451 introduced some stateful interaction between time.time and time.perf_counter, since they both now call py_win_perf_counter_frequency with the same global variable as base.

  • time.time() now calls GetSystemTimePreciseAsFileTime()
  • time.perf_counter() is unchanged
  • time.monotonic() now calls GetSystemTimePreciseAsFileTime().

It's documented at: https://docs.python.org/dev/whatsnew/3.13.html#time

from cpython.

mdboom avatar mdboom commented on July 23, 2024

Yes, but why did that break dask? Because the assumption about time.time having low resolution no longer holds? I think the concern is for possibly breaking other libraries using these APIs.

Sorry, I see you answered my question elsewhere.

from cpython.

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.