bokeh / bokeh

Interactive Data Visualization in the browser, from Python
https://bokeh.org
BSD 3-Clause "New" or "Revised" License
19.35k stars 4.19k forks source link

[BUG] Importing bokeh is VERY slow #10007

Closed samuelcolvin closed 2 years ago

samuelcolvin commented 4 years ago

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Description of expected behavior and the observed behavior

Importing bokeh is very slow, around 1s for me. This is enough to significantly damage the developer experience.

Complete, minimal, self-contained example code that reproduces the issue

where simple_plot.py is:

from bokeh.plotting import figure, output_file, show

p = figure(title='slow plot')

p.circle([1, 2, 3], [4, 5, 6], fill_alpha=0.2, size=10)

output_file('slow.html')
show(p)

This is enough to be visually slow to the user.

output of python -X importtime -c 'from bokeh.plotting import figure':

``` import time: self [us] | cumulative | imported package import time: 680 | 680 | _frozen_importlib_external import time: 405 | 405 | time import time: 239 | 643 | zipimport import time: 73 | 73 | _codecs import time: 642 | 715 | codecs import time: 795 | 795 | encodings.aliases import time: 733 | 2243 | encodings import time: 331 | 331 | encodings.utf_8 import time: 114 | 114 | _signal import time: 464 | 464 | encodings.latin_1 import time: 96 | 96 | _abc import time: 350 | 445 | abc import time: 384 | 829 | io import time: 68 | 68 | _stat import time: 295 | 363 | stat import time: 1370 | 1370 | _collections_abc import time: 327 | 327 | genericpath import time: 508 | 834 | posixpath import time: 784 | 3350 | os import time: 408 | 408 | __builtin__ import time: 89 | 89 | _locale import time: 229 | 317 | _bootlocale import time: 600 | 600 | types import time: 393 | 393 | warnings import time: 305 | 698 | importlib import time: 260 | 260 | importlib.machinery import time: 724 | 983 | importlib.abc import time: 103 | 103 | _operator import time: 449 | 552 | operator import time: 244 | 244 | keyword import time: 419 | 419 | _heapq import time: 279 | 697 | heapq import time: 132 | 132 | itertools import time: 293 | 293 | reprlib import time: 91 | 91 | _collections import time: 1827 | 3833 | collections import time: 67 | 67 | _functools import time: 723 | 789 | functools import time: 1412 | 6034 | contextlib import time: 529 | 8243 | importlib.util import time: 252 | 252 | sitecustomize import time: 2591 | 15760 | site import time: 1091 | 1091 | enum import time: 92 | 92 | _sre import time: 493 | 493 | sre_constants import time: 664 | 1156 | sre_parse import time: 461 | 1707 | sre_compile import time: 316 | 316 | copyreg import time: 760 | 3873 | re import time: 342 | 342 | token import time: 1360 | 1702 | tokenize import time: 305 | 2006 | linecache import time: 515 | 2520 | traceback import time: 341 | 341 | _weakrefset import time: 718 | 1059 | weakref import time: 366 | 366 | collections.abc import time: 46 | 46 | _string import time: 1017 | 1063 | string import time: 833 | 833 | threading import time: 45 | 45 | atexit import time: 2533 | 12288 | logging import time: 410 | 410 | bokeh.util import time: 525 | 525 | _json import time: 680 | 1204 | json.scanner import time: 872 | 2075 | json.decoder import time: 741 | 741 | json.encoder import time: 402 | 3217 | json import time: 203 | 3419 | bokeh._version import time: 414 | 4242 | bokeh.util.version import time: 2426 | 2426 | _hashlib import time: 539 | 539 | _blake2 import time: 547 | 547 | _sha3 import time: 600 | 4111 | hashlib import time: 2225 | 2225 | typing import time: 354 | 354 | urllib import time: 1266 | 1620 | urllib.parse import time: 466 | 466 | _struct import time: 267 | 733 | struct import time: 496 | 496 | binascii import time: 414 | 1641 | base64 import time: 342 | 342 | _bisect import time: 294 | 636 | bisect import time: 351 | 351 | email import time: 1264 | 1264 | http import time: 613 | 613 | email.errors import time: 381 | 381 | email.quoprimime import time: 240 | 240 | email.base64mime import time: 322 | 322 | quopri import time: 219 | 540 | email.encoders import time: 304 | 844 | email.charset import time: 1109 | 2573 | email.header import time: 535 | 535 | math import time: 1080 | 1080 | _sha512 import time: 429 | 429 | _random import time: 568 | 2610 | random import time: 725 | 725 | _socket import time: 517 | 517 | select import time: 787 | 1303 | selectors import time: 89 | 89 | errno import time: 2098 | 4214 | socket import time: 614 | 614 | _datetime import time: 1201 | 1814 | datetime import time: 1139 | 1139 | locale import time: 720 | 1859 | calendar import time: 349 | 2207 | email._parseaddr import time: 809 | 11653 | email.utils import time: 445 | 14670 | email._policybase import time: 876 | 16158 | email.feedparser import time: 442 | 16600 | email.parser import time: 395 | 395 | uu import time: 490 | 490 | email._encoded_words import time: 251 | 251 | email.iterators import time: 745 | 1879 | email.message import time: 1401 | 1401 | _ssl import time: 4367 | 5768 | ssl import time: 1279 | 26787 | http.client import time: 292 | 292 | fnmatch import time: 468 | 468 | zlib import time: 435 | 435 | _compression import time: 466 | 466 | _bz2 import time: 464 | 1364 | bz2 import time: 706 | 706 | _lzma import time: 578 | 1283 | lzma import time: 53 | 53 | pwd import time: 550 | 550 | grp import time: 829 | 4837 | shutil import time: 599 | 5436 | tempfile import time: 294 | 294 | urllib.response import time: 355 | 649 | urllib.error import time: 3772 | 3772 | _scproxy import time: 2176 | 41445 | urllib.request import time: 568 | 49966 | bokeh.util.sampledata import time: 509 | 50475 | bokeh.sampledata import time: 426 | 426 | yaml.error import time: 573 | 573 | yaml.tokens import time: 452 | 452 | yaml.events import time: 319 | 319 | yaml.nodes import time: 8886 | 8886 | yaml.reader import time: 512 | 512 | yaml.scanner import time: 374 | 374 | yaml.parser import time: 302 | 302 | yaml.composer import time: 1884 | 1884 | yaml.constructor import time: 3723 | 3723 | yaml.resolver import time: 598 | 16276 | yaml.loader import time: 668 | 668 | yaml.emitter import time: 390 | 390 | yaml.serializer import time: 459 | 459 | yaml.representer import time: 653 | 2169 | yaml.dumper import time: 220 | 220 | _yaml import time: 276 | 496 | yaml.cyaml import time: 659 | 21366 | yaml import time: 311 | 311 | bokeh.util.paths import time: 651 | 22326 | bokeh.settings import time: 432 | 22758 | bokeh.util.logconfig import time: 319 | 319 | bokeh.util.warnings import time: 582 | 90661 | bokeh import time: 211 | 211 | bokeh.core import time: 327 | 327 | colorsys import time: 1448 | 1448 | bokeh.colors.color import time: 267 | 2040 | bokeh.colors.rgb import time: 275 | 2314 | bokeh.colors.util import time: 483 | 2797 | bokeh.colors.groups import time: 686 | 686 | bokeh.colors.named import time: 275 | 275 | bokeh.colors.hsl import time: 274 | 4031 | bokeh.colors import time: 179 | 179 | org import time: 22 | 200 | org.python import time: 21 | 220 | org.python.core import time: 353 | 572 | copy import time: 641 | 641 | __future__ import time: 507 | 507 | numpy._globals import time: 366 | 366 | numpy.__config__ import time: 223 | 223 | numpy.version import time: 276 | 276 | numpy._distributor_init import time: 2018 | 2018 | textwrap import time: 8096 | 8096 | numpy.core._multiarray_umath import time: 350 | 350 | numpy.compat._inspect import time: 208 | 208 | nt import time: 194 | 194 | nt import time: 181 | 181 | nt import time: 269 | 269 | nt import time: 410 | 1259 | ntpath import time: 1071 | 2330 | pathlib import time: 218 | 218 | pickle5 import time: 539 | 539 | _compat_pickle import time: 679 | 679 | _pickle import time: 192 | 192 | org import time: 22 | 214 | org.python import time: 22 | 235 | org.python.core import time: 1128 | 2580 | pickle import time: 330 | 5456 | numpy.compat.py3k import time: 439 | 6244 | numpy.compat import time: 39 | 6283 | numpy.compat._inspect import time: 698 | 17093 | numpy.core.overrides import time: 3850 | 20942 | numpy.core.multiarray import time: 375 | 375 | numpy.core.umath import time: 616 | 616 | numbers import time: 357 | 357 | numpy.core._string_helpers import time: 285 | 285 | numpy.core._dtype import time: 625 | 910 | numpy.core._type_aliases import time: 506 | 2388 | numpy.core.numerictypes import time: 240 | 240 | numpy.core._asarray import time: 510 | 510 | numpy.core._exceptions import time: 375 | 884 | numpy.core._methods import time: 4076 | 4959 | numpy.core.fromnumeric import time: 968 | 6166 | numpy.core.shape_base import time: 402 | 402 | numpy.core._ufunc_config import time: 1371 | 1371 | numpy.core.arrayprint import time: 2829 | 10767 | numpy.core.numeric import time: 5383 | 5383 | numpy.core.defchararray import time: 558 | 558 | numpy.core.records import time: 335 | 335 | numpy.core.memmap import time: 591 | 591 | numpy.core.function_base import time: 274 | 274 | numpy.core.machar import time: 516 | 516 | numpy.core.getlimits import time: 599 | 599 | numpy.core.einsumfunc import time: 952 | 952 | numpy.core._multiarray_tests import time: 1955 | 2907 | numpy.core._add_newdocs import time: 882 | 882 | _ctypes import time: 437 | 437 | ctypes._endian import time: 1177 | 1613 | ctypes import time: 273 | 2767 | numpy.core._dtype_ctypes import time: 2819 | 2819 | platform import time: 1075 | 3894 | numpy.core._internal import time: 304 | 304 | numpy._pytesttester import time: 1067 | 53659 | numpy.core import time: 445 | 445 | numpy.lib.mixins import time: 486 | 486 | numpy.lib.ufunclike import time: 1218 | 1703 | numpy.lib.type_check import time: 1102 | 2804 | numpy.lib.scimath import time: 89 | 89 | _ast import time: 603 | 692 | ast import time: 1381 | 1381 | numpy.lib.twodim_base import time: 838 | 838 | numpy.linalg.lapack_lite import time: 1954 | 1954 | numpy.linalg._umath_linalg import time: 3230 | 7402 | numpy.linalg.linalg import time: 254 | 7656 | numpy.linalg import time: 494 | 8841 | numpy.matrixlib.defmatrix import time: 225 | 9065 | numpy.matrixlib import time: 929 | 929 | numpy.lib.histograms import time: 3974 | 4902 | numpy.lib.function_base import time: 653 | 653 | numpy.lib.stride_tricks import time: 1030 | 15649 | numpy.lib.index_tricks import time: 1667 | 1667 | numpy.lib.nanfunctions import time: 1436 | 1436 | numpy.lib.shape_base import time: 1634 | 1634 | numpy.lib.polynomial import time: 842 | 842 | numpy.lib.utils import time: 1167 | 1167 | numpy.lib.arraysetops import time: 440 | 440 | numpy.lib.format import time: 525 | 525 | numpy.lib._datasource import time: 979 | 979 | numpy.lib._iotools import time: 1233 | 3175 | numpy.lib.npyio import time: 1466 | 1466 | _decimal import time: 404 | 1869 | decimal import time: 1403 | 3272 | numpy.lib.financial import time: 314 | 314 | numpy.lib.arrayterator import time: 491 | 491 | numpy.lib.arraypad import time: 268 | 268 | numpy.lib._version import time: 576 | 33735 | numpy.lib import time: 382 | 382 | numpy.fft._pocketfft_internal import time: 1768 | 2150 | numpy.fft._pocketfft import time: 453 | 453 | numpy.fft.helper import time: 321 | 2923 | numpy.fft import time: 413 | 413 | numpy.polynomial.polyutils import time: 446 | 446 | numpy.polynomial._polybase import time: 1628 | 2485 | numpy.polynomial.polynomial import time: 535 | 535 | numpy.polynomial.chebyshev import time: 478 | 478 | numpy.polynomial.legendre import time: 423 | 423 | numpy.polynomial.hermite import time: 466 | 466 | numpy.polynomial.hermite_e import time: 421 | 421 | numpy.polynomial.laguerre import time: 337 | 5142 | numpy.polynomial import time: 673 | 673 | numpy.random._common import time: 379 | 379 | hmac import time: 381 | 759 | secrets import time: 821 | 2252 | numpy.random._bit_generator import time: 481 | 481 | numpy.random._bounded_integers import time: 457 | 457 | numpy.random._mt19937 import time: 1372 | 4559 | numpy.random.mtrand import time: 438 | 438 | numpy.random._philox import time: 418 | 418 | numpy.random._pcg64 import time: 414 | 414 | numpy.random._sfc64 import time: 1026 | 1026 | numpy.random._generator import time: 383 | 7236 | numpy.random._pickle import time: 360 | 7595 | numpy.random import time: 601 | 601 | numpy.ctypeslib import time: 3469 | 3469 | numpy.ma.core import time: 930 | 930 | numpy.ma.extras import time: 378 | 4776 | numpy.ma import time: 2700 | 113137 | numpy import time: 9761 | 123469 | bokeh.palettes import time: 1764 | 129474 | bokeh.core.enums import time: 250 | 250 | bokeh.core.property import time: 259 | 259 | bokeh.util.dependencies import time: 344 | 344 | bokeh.util.string import time: 1044 | 1044 | difflib import time: 247 | 247 | bokeh.core.property.descriptor_factory import time: 227 | 227 | bokeh.core.property.override import time: 448 | 448 | pytz.exceptions import time: 416 | 416 | pytz.lazy import time: 703 | 703 | pytz.tzinfo import time: 389 | 389 | pytz.tzfile import time: 1089 | 3043 | pytz import time: 300 | 300 | dateutil._version import time: 411 | 710 | dateutil import time: 343 | 343 | pandas.compat import time: 477 | 477 | _opcode import time: 580 | 1057 | opcode import time: 486 | 486 | distutils.errors import time: 1507 | 1507 | gettext import time: 343 | 1849 | getopt import time: 860 | 2709 | distutils.fancy_getopt import time: 212 | 212 | distutils.dep_util import time: 195 | 195 | distutils.debug import time: 257 | 257 | distutils.log import time: 315 | 765 | distutils.spawn import time: 460 | 1436 | distutils.util import time: 983 | 5613 | distutils.dist import time: 877 | 877 | distutils.sysconfig import time: 633 | 8178 | distutils import time: 756 | 8934 | distutils.version import time: 490 | 9766 | pandas.compat.numpy import time: 400 | 400 | pandas._libs.tslibs.np_datetime import time: 435 | 435 | pandas._libs.ops_dispatch import time: 644 | 1479 | pandas._libs.missing import time: 723 | 2201 | pandas._libs.tslibs.nattype import time: 1426 | 1426 | six import time: 56 | 56 | six.moves import time: 377 | 377 | dateutil.tz._common import time: 296 | 296 | dateutil.tz._factories import time: 39 | 39 | six.moves.winreg import time: 320 | 359 | dateutil.tz.win import time: 1673 | 4183 | dateutil.tz.tz import time: 310 | 4493 | dateutil.tz import time: 673 | 5166 | pandas._libs.tslibs.timezones import time: 874 | 874 | pandas._config.config import time: 469 | 469 | pandas._config.dates import time: 311 | 311 | pandas._config.display import time: 298 | 1950 | pandas._config import time: 1158 | 1158 | signal import time: 218 | 218 | msvcrt import time: 540 | 540 | _posixsubprocess import time: 733 | 2648 | subprocess import time: 281 | 4878 | pandas._config.localization import time: 238 | 238 | backports_abc import time: 1768 | 2006 | pandas._libs.tslibs.strptime import time: 457 | 7340 | pandas._libs.tslibs.ccalendar import time: 210 | 210 | backports_abc import time: 215 | 215 | dateutil._common import time: 425 | 639 | dateutil.relativedelta import time: 1171 | 9359 | pandas._libs.tslibs.offsets import time: 1273 | 10632 | pandas._libs.tslibs.timedeltas import time: 752 | 11384 | pandas._libs.tslibs.tzconversion import time: 685 | 685 | pandas._libs.tslibs.fields import time: 779 | 20212 | pandas._libs.tslibs.c_timestamp import time: 966 | 966 | pandas._libs.tslibs.frequencies import time: 207 | 207 | backports_abc import time: 976 | 976 | dateutil.parser._parser import time: 512 | 512 | dateutil.parser.isoparser import time: 368 | 1855 | dateutil.parser import time: 1006 | 4034 | pandas._libs.tslibs.parsing import time: 898 | 25143 | pandas._libs.tslibs.conversion import time: 248 | 248 | backports_abc import time: 1323 | 1571 | pandas._libs.tslibs.timestamps import time: 845 | 845 | pandas._libs.tslibs.resolution import time: 1696 | 4111 | pandas._libs.tslibs.period import time: 401 | 29654 | pandas._libs.tslibs import time: 276 | 29930 | pandas._libs import time: 1095 | 1095 | pandas._libs.hashtable import time: 1614 | 1614 | fractions import time: 719 | 719 | pandas._libs.tslib import time: 1192 | 3524 | pandas._libs.lib import time: 251 | 251 | pandas.core import time: 1129 | 1379 | pandas.core.config_init import time: 196 | 196 | pandas.core.dtypes import time: 1083 | 1083 | pandas._libs.algos import time: 1090 | 2172 | pandas._libs.interval import time: 1004 | 1004 | pandas._typing import time: 389 | 389 | pandas.errors import time: 921 | 921 | pandas.core.dtypes.generic import time: 408 | 1716 | pandas.core.dtypes.base import time: 304 | 304 | pandas.core.dtypes.inference import time: 1691 | 7081 | pandas.core.dtypes.dtypes import time: 1322 | 1322 | pandas.core.dtypes.common import time: 324 | 1646 | pandas.core.dtypes.missing import time: 672 | 672 | dis import time: 2298 | 2970 | inspect import time: 547 | 547 | pandas._libs.properties import time: 721 | 4237 | pandas.util._decorators import time: 268 | 268 | pandas.core.util import time: 576 | 576 | pandas._libs.hashing import time: 359 | 359 | pandas.util._validators import time: 611 | 970 | pandas.core.dtypes.cast import time: 437 | 2249 | pandas.core.util.hashing import time: 248 | 6732 | pandas.util import time: 32 | 6764 | pandas.util._decorators import time: 501 | 501 | pandas.core.common import time: 615 | 615 | pandas.core.construction import time: 287 | 287 | pandas.core.indexers import time: 1014 | 9178 | pandas.core.algorithms import time: 533 | 533 | pandas.compat.numpy.function import time: 598 | 598 | pandas._libs.ops import time: 196 | 196 | pandas.core.ops.roperator import time: 349 | 544 | pandas.core.ops.missing import time: 265 | 265 | pandas.core.ops.dispatch import time: 214 | 214 | pandas.core.ops.invalid import time: 534 | 2153 | pandas.core.ops.array_ops import time: 269 | 269 | pandas.core.ops.common import time: 343 | 343 | pandas.core.ops.docstrings import time: 363 | 363 | pandas.core.ops.mask_ops import time: 316 | 316 | pandas.core.ops.methods import time: 606 | 4048 | pandas.core.ops import time: 257 | 257 | pandas.compat._optional import time: 400 | 656 | pandas.core.missing import time: 369 | 369 | pandas.core.sorting import time: 1010 | 6614 | pandas.core.arrays.base import time: 1590 | 1590 | pandas.core.nanops import time: 355 | 355 | pandas.core.arrays.masked import time: 766 | 2709 | pandas.core.arrays.boolean import time: 590 | 590 | pandas.core.accessor import time: 1240 | 1240 | pandas.core.base import time: 235 | 235 | pandas.io import time: 363 | 598 | pandas.io.formats import time: 315 | 315 | pandas.io.formats.console import time: 1480 | 4221 | pandas.core.arrays.categorical import time: 217 | 217 | pandas.tseries import time: 224 | 224 | dateutil.easter import time: 2169 | 2392 | pandas.tseries.offsets import time: 626 | 3017 | pandas.tseries.frequencies import time: 1506 | 4739 | pandas.core.arrays.datetimelike import time: 294 | 294 | pandas.core.arrays._ranges import time: 777 | 5809 | pandas.core.arrays.datetimes import time: 221 | 221 | pandas.core.tools import time: 363 | 583 | pandas.core.tools.numeric import time: 1584 | 2166 | pandas.core.arrays.integer import time: 204 | 204 | pandas.core.indexes import time: 899 | 899 | pandas._libs.index import time: 848 | 848 | pandas._libs.join import time: 329 | 329 | pandas.core.dtypes.concat import time: 637 | 637 | pandas.io.formats.printing import time: 332 | 969 | pandas.core.indexes.frozen import time: 2530 | 2530 | pandas.core.strings import time: 2682 | 8458 | pandas.core.indexes.base import time: 1354 | 9812 | pandas.core.arrays.interval import time: 624 | 624 | pandas.core.arrays.numpy_ import time: 756 | 756 | pandas.core.arrays.period import time: 1945 | 1945 | pandas._libs.sparse import time: 414 | 414 | pandas.core.arrays.sparse.dtype import time: 1096 | 3453 | pandas.core.arrays.sparse.array import time: 521 | 3974 | pandas.core.arrays.sparse.accessor import time: 323 | 4296 | pandas.core.arrays.sparse import time: 473 | 473 | pandas.core.arrays.string_ import time: 509 | 509 | pandas.core.arrays.timedeltas import time: 379 | 38363 | pandas.core.arrays import time: 69 | 69 | gc import time: 1089 | 1089 | pandas.core.indexes.extension import time: 1072 | 2160 | pandas.core.indexes.category import time: 1649 | 1649 | pandas.core.indexes.numeric import time: 261 | 261 | pandas.core.tools.timedeltas import time: 904 | 2813 | pandas.core.indexes.datetimelike import time: 217 | 217 | pandas.arrays import time: 581 | 798 | pandas.core.tools.datetimes import time: 1083 | 4692 | pandas.core.indexes.datetimes import time: 218 | 218 | pandas.util._exceptions import time: 1931 | 1931 | pandas.core.indexes.multi import time: 734 | 734 | pandas.core.indexes.timedeltas import time: 1661 | 4543 | pandas.core.indexes.interval import time: 1143 | 1143 | pandas.core.indexes.period import time: 1395 | 1395 | pandas.core.indexes.range import time: 468 | 14398 | pandas.core.indexes.api import time: 474 | 474 | pandas._libs.indexing import time: 1928 | 2401 | pandas.core.indexing import time: 705 | 705 | pandas._libs.writers import time: 287 | 287 | backports_abc import time: 879 | 1166 | pandas._libs.internals import time: 1838 | 3708 | pandas.core.internals.blocks import time: 332 | 332 | pandas.core.internals.concat import time: 1042 | 1374 | pandas.core.internals.managers import time: 380 | 5461 | pandas.core.internals import time: 578 | 578 | unicodedata import time: 671 | 671 | gzip import time: 551 | 551 | mmap import time: 1174 | 1174 | zipfile import time: 758 | 3153 | pandas.io.common import time: 2261 | 5991 | pandas.io.formats.format import time: 5939 | 34257 | pandas.core.generic import time: 437 | 437 | pandas.core.internals.construction import time: 806 | 806 | pandas._libs.reshape import time: 652 | 652 | pandas.core.indexes.accessors import time: 981 | 981 | pandas.plotting._core import time: 331 | 331 | pandas.plotting._misc import time: 267 | 1578 | pandas.plotting import time: 190 | 190 | pandas._libs.window import time: 965 | 1155 | pandas._libs.window.aggregations import time: 441 | 441 | pandas.core.groupby.base import time: 449 | 890 | pandas.core.window.common import time: 491 | 491 | pandas._libs.window.indexers import time: 453 | 944 | pandas.core.window.indexers import time: 452 | 452 | pandas.core.window.numba_ import time: 3322 | 4717 | pandas.core.window.rolling import time: 864 | 7624 | pandas.core.window.ewm import time: 1440 | 1440 | pandas.core.window.expanding import time: 278 | 9341 | pandas.core.window import time: 6692 | 19066 | pandas.core.series import time: 11411 | 65170 | pandas.core.frame import time: 802 | 802 | pandas._libs.groupby import time: 643 | 643 | pandas._libs.reduction import time: 243 | 243 | pandas.core.groupby.categorical import time: 502 | 745 | pandas.core.groupby.grouper import time: 951 | 2338 | pandas.core.groupby.ops import time: 2629 | 5769 | pandas.core.groupby.groupby import time: 2205 | 73142 | pandas.core.groupby.generic import time: 265 | 73406 | pandas.core.groupby import time: 348 | 130020 | pandas.core.api import time: 265 | 265 | pandas.tseries.api import time: 223 | 223 | pandas.core.computation import time: 204 | 204 | pandas.core.computation.common import time: 393 | 596 | pandas.core.computation.align import time: 460 | 460 | pprint import time: 335 | 335 | pandas.compat.chainmap import time: 323 | 1117 | pandas.core.computation.scope import time: 731 | 1847 | pandas.core.computation.ops import time: 414 | 2856 | pandas.core.computation.engines import time: 400 | 400 | pandas.core.computation.parsing import time: 1608 | 2007 | pandas.core.computation.expr import time: 263 | 5125 | pandas.core.computation.eval import time: 348 | 5694 | pandas.core.computation.api import time: 260 | 260 | pandas.core.reshape import time: 655 | 655 | pandas.core.reshape.concat import time: 531 | 531 | pandas.core.reshape.melt import time: 1873 | 1873 | pandas.core.reshape.merge import time: 212 | 212 | pandas.core.reshape.util import time: 913 | 1125 | pandas.core.reshape.pivot import time: 531 | 531 | pandas.core.reshape.reshape import time: 399 | 399 | pandas.core.reshape.tile import time: 401 | 5771 | pandas.core.reshape.api import time: 308 | 308 | pandas.api.extensions import time: 223 | 223 | pandas.api.indexers import time: 198 | 198 | pandas.core.dtypes.api import time: 237 | 435 | pandas.api.types import time: 284 | 1248 | pandas.api import time: 338 | 338 | pandas.util._print_versions import time: 212 | 212 | pandas.io.clipboards import time: 341 | 341 | backports_abc import time: 555 | 555 | _csv import time: 694 | 1248 | csv import time: 19563 | 21150 | pandas._libs.parsers import time: 289 | 289 | pandas.io.excel._util import time: 228 | 228 | pandas.io.date_converters import time: 2098 | 2325 | pandas.io.parsers import time: 374 | 374 | pandas.io.excel._odfreader import time: 447 | 447 | pandas.io.excel._openpyxl import time: 299 | 299 | pandas.io.excel._xlrd import time: 373 | 373 | pandas.io.excel._pyxlsb import time: 1121 | 26375 | pandas.io.excel._base import time: 464 | 464 | pandas._libs.json import time: 505 | 968 | pandas.io.excel._xlsxwriter import time: 328 | 328 | pandas.io.excel._xlwt import time: 286 | 27956 | pandas.io.excel import time: 302 | 302 | pandas.io.feather_format import time: 370 | 370 | pandas.io.gbq import time: 684 | 684 | pandas.io.html import time: 915 | 915 | pandas.io.json._normalize import time: 314 | 314 | pandas.io.json._table_schema import time: 772 | 2000 | pandas.io.json._json import time: 263 | 2262 | pandas.io.json import time: 238 | 238 | pandas.io.orc import time: 358 | 358 | pandas.io.parquet import time: 353 | 353 | pandas.compat.pickle_compat import time: 256 | 608 | pandas.io.pickle import time: 939 | 939 | pandas.core.computation.pytables import time: 2827 | 3766 | pandas.io.pytables import time: 326 | 326 | pandas.io.sas.sasreader import time: 271 | 596 | pandas.io.sas import time: 257 | 257 | pandas.io.spss import time: 653 | 653 | pandas.io.sql import time: 1500 | 1500 | pandas.io.stata import time: 396 | 40153 | pandas.io.api import time: 235 | 235 | pandas.util._tester import time: 420 | 420 | pandas._libs.testing import time: 1061 | 1480 | pandas._testing import time: 208 | 1687 | pandas.testing import time: 231 | 231 | pandas._version import time: 1180 | 236260 | bokeh.core.property.wrappers import time: 469 | 238244 | bokeh.core.has_props import time: 613 | 613 | bokeh.core.property.descriptors import time: 495 | 239953 | bokeh.core.property.bases import time: 413 | 240614 | bokeh.core.property.any import time: 304 | 304 | bokeh.core.property.primitive import time: 261 | 565 | bokeh.core.property.enum import time: 265 | 829 | bokeh.core.property.auto import time: 866 | 866 | _uuid import time: 7424 | 8290 | uuid import time: 704 | 8994 | bokeh.util.serialization import time: 506 | 506 | bokeh.core.property.numeric import time: 571 | 10070 | bokeh.core.property.container import time: 305 | 305 | bokeh.core.property.either import time: 309 | 309 | bokeh.core.property.string import time: 430 | 11113 | bokeh.core.property.color import time: 310 | 310 | bokeh.core.property.datetime import time: 293 | 293 | bokeh.core.property.instance import time: 425 | 425 | PIL._version import time: 463 | 887 | PIL import time: 246 | 246 | PIL.ImageMode import time: 2076 | 2076 | PIL.TiffTags import time: 264 | 264 | PIL._binary import time: 230 | 230 | PIL._util import time: 3176 | 3176 | PIL._imaging import time: 223 | 223 | cffi.lock import time: 297 | 297 | cffi.error import time: 854 | 854 | cffi.model import time: 1038 | 2410 | cffi.api import time: 599 | 3009 | cffi import time: 1658 | 11542 | PIL.Image import time: 1131 | 12672 | bokeh.core.property.visual import time: 888 | 14162 | bokeh.core.property.dataspec import time: 300 | 300 | bokeh.core.property.include import time: 279 | 279 | bokeh.core.property.json import time: 298 | 298 | bokeh.core.property.pandas import time: 273 | 273 | bokeh.core.property.struct import time: 265 | 265 | bokeh.core.property.validation import time: 740 | 268870 | bokeh.core.properties import time: 556 | 556 | bokeh.core.json_encoder import time: 1106 | 1106 | bokeh.events import time: 388 | 388 | bokeh.themes._caliber import time: 258 | 258 | bokeh.themes._dark_minimal import time: 218 | 218 | bokeh.themes._light_minimal import time: 341 | 341 | bokeh.themes.theme import time: 480 | 1683 | bokeh.themes import time: 233 | 233 | bokeh.util.functions import time: 454 | 687 | bokeh.util.callback_manager import time: 1296 | 5327 | bokeh.model import time: 5100 | 5100 | bokeh.core.property_mixins import time: 431 | 431 | bokeh.core.validation.check import time: 255 | 255 | bokeh.core.validation.decorators import time: 349 | 1035 | bokeh.core.validation import time: 536 | 536 | bokeh.core.validation.errors import time: 1272 | 1272 | bokeh.models.tickers import time: 526 | 526 | bokeh.models.glyph import time: 410 | 410 | bokeh.models.callbacks import time: 667 | 667 | bokeh.models.filters import time: 474 | 474 | bokeh.models.selections import time: 1135 | 2685 | bokeh.models.sources import time: 771 | 3456 | bokeh.models.transforms import time: 1490 | 4946 | bokeh.models.mappers import time: 2051 | 2051 | bokeh.models.markers import time: 15129 | 22650 | bokeh.models.glyphs import time: 1636 | 25557 | bokeh.models.formatters import time: 544 | 544 | bokeh.models.graphs import time: 736 | 736 | bokeh.models.tiles import time: 1179 | 2458 | bokeh.models.renderers import time: 9462 | 44145 | bokeh.models.annotations import time: 1217 | 1217 | bokeh.models.arrow_heads import time: 2310 | 2310 | bokeh.models.axes import time: 449 | 449 | bokeh.models.expressions import time: 878 | 878 | bokeh.models.grids import time: 342 | 342 | bokeh.core.validation.warnings import time: 2030 | 2371 | bokeh.models.layouts import time: 1429 | 1429 | bokeh.models.ranges import time: 722 | 722 | bokeh.core.query import time: 498 | 498 | bokeh.models.scales import time: 5149 | 5149 | bokeh.models.tools import time: 1609 | 7976 | bokeh.models.plots import time: 712 | 10116 | bokeh.models.map_plots import time: 495 | 495 | bokeh.models.textures import time: 259 | 259 | bokeh.models.widgets.icons import time: 360 | 360 | bokeh.models.widgets.widget import time: 1824 | 2442 | bokeh.models.widgets.buttons import time: 901 | 901 | bokeh.models.widgets.groups import time: 1720 | 1720 | bokeh.models.widgets.inputs import time: 524 | 524 | bokeh.models.widgets.markups import time: 321 | 321 | bokeh.models.widgets.panels import time: 1160 | 1160 | bokeh.models.widgets.sliders import time: 2246 | 2246 | bokeh.models.widgets.tables import time: 397 | 9709 | bokeh.models.widgets import time: 578 | 77589 | bokeh.models import time: 282 | 282 | bokeh.transform import time: 319 | 319 | bokeh.util.options import time: 222 | 222 | bokeh.plotting._docstring import time: 278 | 278 | bokeh.util.deprecation import time: 339 | 617 | bokeh.plotting._legends import time: 330 | 947 | bokeh.plotting._renderer import time: 258 | 1426 | bokeh.plotting._decorators import time: 298 | 298 | bokeh.plotting._graph import time: 349 | 349 | bokeh.plotting._plot import time: 230 | 230 | bokeh.plotting._stack import time: 912 | 912 | typing_extensions import time: 753 | 1664 | bokeh.plotting._tools import time: 19262 | 499758 | bokeh.plotting.figure import time: 1105 | 1105 | bokeh.plotting.gmap import time: 284 | 284 | bokeh.plotting.graph import time: 280 | 280 | markupsafe._compat import time: 379 | 379 | markupsafe._speedups import time: 982 | 1641 | markupsafe import time: 378 | 378 | jinja2._compat import time: 1314 | 1314 | jinja2.utils import time: 621 | 2312 | jinja2.bccache import time: 2694 | 2694 | jinja2.nodes import time: 593 | 593 | jinja2.exceptions import time: 386 | 386 | jinja2.visitor import time: 512 | 897 | jinja2.idtracking import time: 304 | 304 | jinja2.optimizer import time: 1462 | 3255 | jinja2.compiler import time: 2344 | 2344 | jinja2.runtime import time: 1038 | 3381 | jinja2.filters import time: 457 | 457 | jinja2.tests import time: 375 | 4212 | jinja2.defaults import time: 1676 | 1676 | jinja2._identifier import time: 2040 | 3715 | jinja2.lexer import time: 499 | 499 | jinja2.parser import time: 1142 | 15515 | jinja2.environment import time: 507 | 507 | jinja2.loaders import time: 486 | 20459 | jinja2 import time: 366 | 366 | encodings.unicode_escape import time: 42746 | 43111 | bokeh.core.templates import time: 378 | 378 | bokeh.util.datatypes import time: 637 | 637 | bokeh.document.events import time: 265 | 265 | bokeh.document.locking import time: 245 | 245 | bokeh.document.util import time: 876 | 65967 | bokeh.document.document import time: 270 | 66237 | bokeh.document import time: 306 | 306 | bokeh.io.doc import time: 681 | 681 | bokeh.util.token import time: 1622 | 2302 | bokeh.resources import time: 537 | 537 | bokeh.util.compiler import time: 669 | 1205 | bokeh.embed.bundle import time: 1353 | 1353 | html.entities import time: 703 | 2056 | html import time: 469 | 469 | bokeh.embed.util import time: 382 | 382 | bokeh.embed.wrappers import time: 417 | 3323 | bokeh.embed.elements import time: 400 | 7229 | bokeh.embed.server import time: 666 | 666 | bokeh.embed.standalone import time: 236 | 8130 | bokeh.embed import time: 252 | 252 | bokeh.io.util import time: 469 | 8849 | bokeh.io.export import time: 263 | 263 | bokeh.io.state import time: 379 | 642 | bokeh.io.notebook import time: 228 | 228 | bokeh.io.output import time: 256 | 256 | bokeh.io.saving import time: 506 | 506 | shlex import time: 804 | 1309 | webbrowser import time: 343 | 1651 | bokeh.util.browser import time: 251 | 1902 | bokeh.io.showing import time: 340 | 12519 | bokeh.io import time: 416 | 416 | bokeh.layouts import time: 463 | 671438 | bokeh.plotting ```
bryevdv commented 4 years ago

We have looked at this before but unfortunately there may not be much we can do. We import NumPy always, and Pandas if it is available. On my machine those alone account for the large majority of time:

In [1]: %timeit !python -c 'from bokeh.plotting import figure'
533 ms ± 5.29 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

In [2]: %timeit !python -c 'import pandas'
295 ms ± 2.78 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

In [3]: %timeit !python -c 'import numpy'
140 ms ± 3.78 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

There is nothing we can do about that overhead on our end.

That said Python 3.7 has a new import profiling mode. Quickly, without yet looking at them in any detail, here are the results that might point to some tweaks that can be made:

``` (202) ❯ PYTHONPROFILEIMPORTTIME=1 python -c 'from bokeh.plotting import figure' import time: self [us] | cumulative | imported package import time: 426 | 426 | _frozen_importlib_external import time: 441 | 441 | time import time: 166 | 607 | zipimport import time: 51 | 51 | _codecs import time: 1433 | 1483 | codecs import time: 1569 | 1569 | encodings.aliases import time: 3591 | 6642 | encodings import time: 1538 | 1538 | encodings.utf_8 import time: 72 | 72 | _signal import time: 1206 | 1206 | encodings.latin_1 import time: 45 | 45 | _abc import time: 1187 | 1231 | abc import time: 1560 | 2791 | io import time: 101 | 101 | _stat import time: 916 | 1017 | stat import time: 1934 | 1934 | _collections_abc import time: 1964 | 1964 | genericpath import time: 1473 | 3437 | posixpath import time: 2894 | 9280 | os import time: 3748 | 3748 | _sitebuiltins import time: 1128 | 1128 | sitecustomize import time: 96 | 96 | usercustomize import time: 4173 | 18425 | site import time: 1347 | 1347 | types import time: 1533 | 2880 | enum import time: 108 | 108 | _sre import time: 1070 | 1070 | sre_constants import time: 1128 | 2198 | sre_parse import time: 1117 | 3422 | sre_compile import time: 112 | 112 | _operator import time: 1372 | 1484 | operator import time: 1194 | 1194 | keyword import time: 107156 | 107156 | _heapq import time: 3182 | 110338 | heapq import time: 144 | 144 | itertools import time: 1241 | 1241 | reprlib import time: 77 | 77 | _collections import time: 2109 | 116583 | collections import time: 46 | 46 | _functools import time: 1658 | 118287 | functools import time: 69 | 69 | _locale import time: 653 | 653 | copyreg import time: 1303 | 126611 | re import time: 1392 | 1392 | token import time: 1396 | 2788 | tokenize import time: 517 | 3304 | linecache import time: 1340 | 4644 | traceback import time: 3776 | 3776 | warnings import time: 5021 | 5021 | _weakrefset import time: 3898 | 8919 | weakref import time: 1495 | 1495 | collections.abc import time: 46 | 46 | _string import time: 1438 | 1484 | string import time: 1272 | 1272 | threading import time: 40 | 40 | atexit import time: 3201 | 151438 | logging import time: 2162 | 2162 | bokeh.util import time: 2167 | 2167 | _json import time: 844 | 3010 | json.scanner import time: 1421 | 4431 | json.decoder import time: 1236 | 1236 | json.encoder import time: 1497 | 7162 | json import time: 1158 | 8320 | bokeh._version import time: 868 | 11348 | bokeh.util.version import time: 7743 | 7743 | _hashlib import time: 2791 | 2791 | _blake2 import time: 2823 | 2823 | _sha3 import time: 1075 | 14430 | hashlib import time: 1039 | 1039 | contextlib import time: 2500 | 3538 | typing import time: 1563 | 1563 | urllib import time: 1419 | 2982 | urllib.parse import time: 102784 | 102784 | _struct import time: 1207 | 103991 | struct import time: 6215 | 6215 | binascii import time: 781 | 110987 | base64 import time: 3434 | 3434 | _bisect import time: 1384 | 4817 | bisect import time: 3569 | 3569 | email import time: 5609 | 5609 | http import time: 1122 | 1122 | email.errors import time: 613 | 613 | email.quoprimime import time: 832 | 832 | email.base64mime import time: 610 | 610 | quopri import time: 661 | 1270 | email.encoders import time: 1050 | 2319 | email.charset import time: 1392 | 5155 | email.header import time: 2612 | 2612 | math import time: 9939 | 9939 | _sha512 import time: 2441 | 2441 | _random import time: 1256 | 16246 | random import time: 2983 | 2983 | _socket import time: 3011 | 3011 | select import time: 1685 | 4695 | selectors import time: 74 | 74 | errno import time: 1952 | 9703 | socket import time: 3260 | 3260 | _datetime import time: 3165 | 6424 | datetime import time: 1178 | 1178 | locale import time: 1056 | 2234 | calendar import time: 1007 | 3240 | email._parseaddr import time: 1334 | 36946 | email.utils import time: 699 | 42799 | email._policybase import time: 1074 | 44993 | email.feedparser import time: 1014 | 46007 | email.parser import time: 923 | 923 | uu import time: 1137 | 1137 | email._encoded_words import time: 724 | 724 | email.iterators import time: 872 | 3654 | email.message import time: 5774 | 5774 | _ssl import time: 3352 | 9125 | ssl import time: 4063 | 68455 | http.client import time: 917 | 917 | fnmatch import time: 105983 | 105983 | zlib import time: 1316 | 1316 | _compression import time: 3313 | 3313 | _bz2 import time: 1087 | 5715 | bz2 import time: 214864 | 214864 | _lzma import time: 1530 | 216393 | lzma import time: 76 | 76 | pwd import time: 3164 | 3164 | grp import time: 1155 | 333400 | shutil import time: 895 | 334295 | tempfile import time: 642 | 642 | urllib.response import time: 1848 | 2490 | urllib.error import time: 5256 | 5256 | _scproxy import time: 2105 | 531971 | urllib.request import time: 1496 | 554415 | bokeh.util.sampledata import time: 1412 | 555827 | bokeh.sampledata import time: 2061 | 2061 | yaml.error import time: 799 | 799 | yaml.tokens import time: 868 | 868 | yaml.events import time: 865 | 865 | yaml.nodes import time: 7810 | 7810 | yaml.reader import time: 1130 | 1130 | yaml.scanner import time: 718 | 718 | yaml.parser import time: 463 | 463 | yaml.composer import time: 1444 | 1444 | yaml.constructor import time: 2688 | 2688 | yaml.resolver import time: 818 | 15068 | yaml.loader import time: 946 | 946 | yaml.emitter import time: 552 | 552 | yaml.serializer import time: 801 | 801 | yaml.representer import time: 709 | 3006 | yaml.dumper import time: 3791 | 3791 | _yaml import time: 615 | 4406 | yaml.cyaml import time: 2973 | 30042 | yaml import time: 1666 | 1666 | bokeh.util.paths import time: 2793 | 34499 | bokeh.settings import time: 2191 | 36689 | bokeh.util.logconfig import time: 1460 | 1460 | bokeh.util.warnings import time: 2627 | 759387 | bokeh import time: 967 | 967 | bokeh.core import time: 356 | 356 | colorsys import time: 1102 | 1102 | bokeh.colors.color import time: 1005 | 2463 | bokeh.colors.rgb import time: 1075 | 3537 | bokeh.colors.util import time: 955 | 4492 | bokeh.colors.groups import time: 1033 | 1033 | bokeh.colors.named import time: 1591 | 1591 | bokeh.colors.hsl import time: 1322 | 8436 | bokeh.colors import time: 116 | 116 | org import time: 18 | 134 | org.python import time: 18 | 151 | org.python.core import time: 808 | 959 | copy import time: 559 | 559 | __future__ import time: 1790 | 1790 | numpy._globals import time: 921 | 921 | numpy.__config__ import time: 1250 | 1250 | numpy.version import time: 5316 | 5316 | _ctypes import time: 927 | 927 | ctypes._endian import time: 1381 | 7623 | ctypes import time: 66924 | 66924 | mkl._mklinit import time: 86 | 86 | mkl.six import time: 2788 | 2788 | six import time: 62 | 62 | mkl.warnings import time: 3728 | 6662 | mkl._py_mkl_service import time: 1986 | 83193 | mkl import time: 1077 | 84270 | numpy._distributor_init import time: 1647 | 1647 | textwrap import time: 5428 | 5428 | numpy.core._multiarray_umath import time: 5611 | 5611 | numpy.compat._inspect import time: 134 | 134 | nt import time: 101 | 101 | nt import time: 93 | 93 | nt import time: 92 | 92 | nt import time: 782 | 1200 | ntpath import time: 2179 | 3379 | pathlib import time: 118 | 118 | pickle5 import time: 1117 | 1117 | _compat_pickle import time: 2882 | 2882 | _pickle import time: 144 | 144 | org import time: 18 | 162 | org.python import time: 23 | 184 | org.python.core import time: 1534 | 5716 | pickle import time: 2755 | 11966 | numpy.compat.py3k import time: 3216 | 20792 | numpy.compat import time: 22 | 20814 | numpy.compat._inspect import time: 1815 | 29702 | numpy.core.overrides import time: 4141 | 33843 | numpy.core.multiarray import time: 1678 | 1678 | numpy.core.umath import time: 882 | 882 | numbers import time: 1110 | 1110 | numpy.core._string_helpers import time: 1201 | 1201 | numpy.core._dtype import time: 893 | 2093 | numpy.core._type_aliases import time: 1674 | 5758 | numpy.core.numerictypes import time: 750 | 750 | numpy.core._asarray import time: 763 | 763 | numpy.core._exceptions import time: 573 | 1336 | numpy.core._methods import time: 3605 | 4940 | numpy.core.fromnumeric import time: 2521 | 8210 | numpy.core.shape_base import time: 1517 | 1517 | numpy.core._ufunc_config import time: 1221 | 1221 | numpy.core.arrayprint import time: 2860 | 13807 | numpy.core.numeric import time: 3071 | 3071 | numpy.core.defchararray import time: 1376 | 1376 | numpy.core.records import time: 1398 | 1398 | numpy.core.memmap import time: 787 | 787 | numpy.core.function_base import time: 534 | 534 | numpy.core.machar import time: 960 | 960 | numpy.core.getlimits import time: 932 | 932 | numpy.core.einsumfunc import time: 2839 | 2839 | numpy.core._multiarray_tests import time: 2034 | 4873 | numpy.core._add_newdocs import time: 761 | 761 | numpy.core._dtype_ctypes import time: 2201 | 2201 | platform import time: 1511 | 3712 | numpy.core._internal import time: 543 | 543 | numpy._pytesttester import time: 2690 | 76712 | numpy.core import time: 2814 | 2814 | numpy.lib.mixins import time: 5463 | 5463 | numpy.lib.ufunclike import time: 4458 | 9921 | numpy.lib.type_check import time: 1155 | 11075 | numpy.lib.scimath import time: 69 | 69 | _ast import time: 1313 | 1382 | ast import time: 1559 | 1559 | numpy.lib.twodim_base import time: 2836 | 2836 | numpy.linalg.lapack_lite import time: 2939 | 2939 | numpy.linalg._umath_linalg import time: 2489 | 9821 | numpy.linalg.linalg import time: 1577 | 11398 | numpy.linalg import time: 1304 | 14083 | numpy.matrixlib.defmatrix import time: 1071 | 15153 | numpy.matrixlib import time: 1363 | 1363 | numpy.lib.histograms import time: 2608 | 3970 | numpy.lib.function_base import time: 752 | 752 | numpy.lib.stride_tricks import time: 1221 | 21095 | numpy.lib.index_tricks import time: 1974 | 1974 | numpy.lib.nanfunctions import time: 1769 | 1769 | numpy.lib.shape_base import time: 1577 | 1577 | numpy.lib.polynomial import time: 1303 | 1303 | numpy.lib.utils import time: 1749 | 1749 | numpy.lib.arraysetops import time: 750 | 750 | numpy.lib.format import time: 842 | 842 | numpy.lib._datasource import time: 883 | 883 | numpy.lib._iotools import time: 1395 | 3868 | numpy.lib.npyio import time: 3529 | 3529 | _decimal import time: 614 | 4143 | decimal import time: 1319 | 5461 | numpy.lib.financial import time: 715 | 715 | numpy.lib.arrayterator import time: 802 | 802 | numpy.lib.arraypad import time: 943 | 943 | numpy.lib._version import time: 4145 | 59283 | numpy.lib import time: 2311 | 2311 | numpy.fft._pocketfft_internal import time: 1641 | 3951 | numpy.fft._pocketfft import time: 710 | 710 | numpy.fft.helper import time: 925 | 5585 | numpy.fft import time: 3905 | 3905 | numpy.polynomial.polyutils import time: 5010 | 5010 | numpy.polynomial._polybase import time: 2287 | 11201 | numpy.polynomial.polynomial import time: 2212 | 2212 | numpy.polynomial.chebyshev import time: 992 | 992 | numpy.polynomial.legendre import time: 794 | 794 | numpy.polynomial.hermite import time: 757 | 757 | numpy.polynomial.hermite_e import time: 759 | 759 | numpy.polynomial.laguerre import time: 2049 | 18761 | numpy.polynomial import time: 3009 | 3009 | numpy.random._common import time: 971 | 971 | hmac import time: 1221 | 2191 | secrets import time: 2768 | 7966 | numpy.random._bit_generator import time: 2627 | 2627 | numpy.random._bounded_integers import time: 2233 | 2233 | numpy.random._mt19937 import time: 3842 | 16667 | numpy.random.mtrand import time: 2329 | 2329 | numpy.random._philox import time: 1868 | 1868 | numpy.random._pcg64 import time: 2446 | 2446 | numpy.random._sfc64 import time: 3434 | 3434 | numpy.random._generator import time: 1040 | 27782 | numpy.random._pickle import time: 1284 | 29065 | numpy.random import time: 896 | 896 | numpy.ctypeslib import time: 3071 | 3071 | numpy.ma.core import time: 1339 | 1339 | numpy.ma.extras import time: 1070 | 5479 | numpy.ma import time: 257269 | 541835 | numpy import time: 6777 | 549570 | bokeh.palettes import time: 2367 | 561338 | bokeh.core.enums import time: 3323 | 3323 | bokeh.core.property import time: 873 | 873 | importlib import time: 1182 | 2055 | bokeh.util.dependencies import time: 1402 | 1402 | bokeh.util.string import time: 1336 | 1336 | difflib import time: 2857 | 2857 | bokeh.core.property.descriptor_factory import time: 3620 | 3620 | bokeh.core.property.override import time: 673 | 673 | pytz.exceptions import time: 600 | 600 | pytz.lazy import time: 654 | 654 | pytz.tzinfo import time: 510 | 510 | pytz.tzfile import time: 2192 | 4625 | pytz import time: 809 | 809 | dateutil._version import time: 2085 | 2894 | dateutil import time: 1803 | 1803 | pandas.compat import time: 614 | 614 | distutils import time: 1314 | 1928 | distutils.version import time: 1557 | 5287 | pandas.compat.numpy import time: 2204 | 2204 | pandas._libs.tslibs.np_datetime import time: 2202 | 2202 | pandas._libs.ops_dispatch import time: 2730 | 7135 | pandas._libs.missing import time: 3131 | 10265 | pandas._libs.tslibs.nattype import time: 49 | 49 | six.moves import time: 927 | 927 | dateutil.tz._common import time: 554 | 554 | dateutil.tz._factories import time: 30 | 30 | six.moves.winreg import time: 864 | 893 | dateutil.tz.win import time: 2685 | 5107 | dateutil.tz.tz import time: 1556 | 6662 | dateutil.tz import time: 2724 | 9386 | pandas._libs.tslibs.timezones import time: 1763 | 1763 | pandas._config.config import time: 1149 | 1149 | pandas._config.dates import time: 1104 | 1104 | pandas._config.display import time: 1082 | 5095 | pandas._config import time: 1566 | 1566 | signal import time: 128 | 128 | msvcrt import time: 2330 | 2330 | _posixsubprocess import time: 1000 | 5023 | subprocess import time: 1222 | 11339 | pandas._config.localization import time: 192 | 192 | backports_abc import time: 5303 | 5494 | pandas._libs.tslibs.strptime import time: 2251 | 19083 | pandas._libs.tslibs.ccalendar import time: 144 | 144 | backports_abc import time: 847 | 847 | dateutil._common import time: 1026 | 1872 | dateutil.relativedelta import time: 2786 | 23883 | pandas._libs.tslibs.offsets import time: 2849 | 26732 | pandas._libs.tslibs.timedeltas import time: 2628 | 29359 | pandas._libs.tslibs.tzconversion import time: 2978 | 2978 | pandas._libs.tslibs.fields import time: 2909 | 54895 | pandas._libs.tslibs.c_timestamp import time: 3188 | 3188 | pandas._libs.tslibs.frequencies import time: 150 | 150 | backports_abc import time: 1280 | 1280 | dateutil.parser._parser import time: 1009 | 1009 | dateutil.parser.isoparser import time: 1018 | 3306 | dateutil.parser import time: 3336 | 9979 | pandas._libs.tslibs.parsing import time: 11817 | 76690 | pandas._libs.tslibs.conversion import time: 141 | 141 | backports_abc import time: 2829 | 2970 | pandas._libs.tslibs.timestamps import time: 2527 | 2527 | pandas._libs.tslibs.resolution import time: 3168 | 8664 | pandas._libs.tslibs.period import time: 1348 | 86701 | pandas._libs.tslibs import time: 1794 | 88495 | pandas._libs import time: 2933 | 2933 | pandas._libs.hashtable import time: 1467 | 1467 | fractions import time: 2986 | 2986 | pandas._libs.tslib import time: 2881 | 7332 | pandas._libs.lib import time: 1636 | 1636 | pandas.core import time: 2016 | 3652 | pandas.core.config_init import time: 1400 | 1400 | pandas.core.dtypes import time: 3148 | 3148 | pandas._libs.algos import time: 3258 | 6405 | pandas._libs.interval import time: 1592 | 1592 | pandas._typing import time: 1703 | 1703 | pandas.errors import time: 1103 | 1103 | pandas.core.dtypes.generic import time: 1157 | 3962 | pandas.core.dtypes.base import time: 1244 | 1244 | pandas.core.dtypes.inference import time: 2417 | 17018 | pandas.core.dtypes.dtypes import time: 1503 | 1503 | pandas.core.dtypes.common import time: 1290 | 2793 | pandas.core.dtypes.missing import time: 2389 | 2389 | _opcode import time: 812 | 3200 | opcode import time: 4504 | 7704 | dis import time: 1237 | 1237 | importlib.machinery import time: 2233 | 11173 | inspect import time: 3275 | 3275 | pandas._libs.properties import time: 1066 | 15512 | pandas.util._decorators import time: 1457 | 1457 | pandas.core.util import time: 2598 | 2598 | pandas._libs.hashing import time: 1337 | 1337 | pandas.util._validators import time: 811 | 2148 | pandas.core.dtypes.cast import time: 1131 | 7332 | pandas.core.util.hashing import time: 1071 | 23914 | pandas.util import time: 22 | 23936 | pandas.util._decorators import time: 1102 | 1102 | pandas.core.common import time: 1483 | 1483 | pandas.core.construction import time: 557 | 557 | pandas.core.indexers import time: 1796 | 28872 | pandas.core.algorithms import time: 960 | 960 | pandas.compat.numpy.function import time: 2822 | 2822 | pandas._libs.ops import time: 738 | 738 | pandas.core.ops.roperator import time: 1158 | 1895 | pandas.core.ops.missing import time: 1160 | 1160 | pandas.core.ops.dispatch import time: 939 | 939 | pandas.core.ops.invalid import time: 745 | 7560 | pandas.core.ops.array_ops import time: 632 | 632 | pandas.core.ops.common import time: 1055 | 1055 | pandas.core.ops.docstrings import time: 932 | 932 | pandas.core.ops.mask_ops import time: 1246 | 1246 | pandas.core.ops.methods import time: 1771 | 13192 | pandas.core.ops import time: 805 | 805 | pandas.compat._optional import time: 972 | 1777 | pandas.core.missing import time: 1238 | 1238 | pandas.core.sorting import time: 1845 | 19009 | pandas.core.arrays.base import time: 1574 | 1574 | pandas.core.nanops import time: 1339 | 1339 | pandas.core.arrays.masked import time: 1126 | 4038 | pandas.core.arrays.boolean import time: 994 | 994 | pandas.core.accessor import time: 1454 | 1454 | pandas.core.base import time: 965 | 965 | pandas.io import time: 974 | 1938 | pandas.io.formats import time: 546 | 546 | pandas.io.formats.console import time: 2196 | 7127 | pandas.core.arrays.categorical import time: 582 | 582 | pandas.tseries import time: 820 | 820 | dateutil.easter import time: 1920 | 2740 | pandas.tseries.offsets import time: 792 | 3532 | pandas.tseries.frequencies import time: 1751 | 5864 | pandas.core.arrays.datetimelike import time: 1169 | 1169 | pandas.core.arrays._ranges import time: 1095 | 8127 | pandas.core.arrays.datetimes import time: 1098 | 1098 | pandas.core.tools import time: 943 | 2041 | pandas.core.tools.numeric import time: 3267 | 5307 | pandas.core.arrays.integer import time: 915 | 915 | pandas.core.indexes import time: 3333 | 3333 | pandas._libs.index import time: 3750 | 3750 | pandas._libs.join import time: 1137 | 1137 | pandas.core.dtypes.concat import time: 848 | 848 | pandas.io.formats.printing import time: 1096 | 1943 | pandas.core.indexes.frozen import time: 2894 | 2894 | pandas.core.strings import time: 5563 | 19532 | pandas.core.indexes.base import time: 2473 | 22005 | pandas.core.arrays.interval import time: 970 | 970 | pandas.core.arrays.numpy_ import time: 1722 | 1722 | pandas.core.arrays.period import time: 3197 | 3197 | pandas._libs.sparse import time: 661 | 661 | pandas.core.arrays.sparse.dtype import time: 1301 | 5159 | pandas.core.arrays.sparse.array import time: 787 | 5945 | pandas.core.arrays.sparse.accessor import time: 1152 | 7097 | pandas.core.arrays.sparse import time: 978 | 978 | pandas.core.arrays.string_ import time: 830 | 830 | pandas.core.arrays.timedeltas import time: 1404 | 78608 | pandas.core.arrays import time: 65 | 65 | gc import time: 907 | 907 | pandas.core.indexes.extension import time: 1505 | 2412 | pandas.core.indexes.category import time: 2088 | 2088 | pandas.core.indexes.numeric import time: 743 | 743 | pandas.core.tools.timedeltas import time: 1206 | 4036 | pandas.core.indexes.datetimelike import time: 837 | 837 | pandas.arrays import time: 1014 | 1850 | pandas.core.tools.datetimes import time: 1124 | 7008 | pandas.core.indexes.datetimes import time: 723 | 723 | pandas.util._exceptions import time: 1748 | 1748 | pandas.core.indexes.multi import time: 1072 | 1072 | pandas.core.indexes.timedeltas import time: 1733 | 5275 | pandas.core.indexes.interval import time: 1110 | 1110 | pandas.core.indexes.period import time: 1244 | 1244 | pandas.core.indexes.range import time: 1025 | 18071 | pandas.core.indexes.api import time: 2459 | 2459 | pandas._libs.indexing import time: 1642 | 4101 | pandas.core.indexing import time: 5921 | 5921 | pandas._libs.writers import time: 154 | 154 | backports_abc import time: 2663 | 2816 | pandas._libs.internals import time: 1755 | 10491 | pandas.core.internals.blocks import time: 657 | 657 | pandas.core.internals.concat import time: 1267 | 1923 | pandas.core.internals.managers import time: 915 | 13328 | pandas.core.internals import time: 3084 | 3084 | unicodedata import time: 803 | 803 | gzip import time: 2102 | 2102 | mmap import time: 773 | 773 | importlib.abc import time: 733 | 1506 | importlib.util import time: 1241 | 2747 | zipfile import time: 919 | 6569 | pandas.io.common import time: 2051 | 11703 | pandas.io.formats.format import time: 5099 | 52364 | pandas.core.generic import time: 845 | 845 | pandas.core.internals.construction import time: 3654 | 3654 | pandas._libs.reshape import time: 886 | 886 | pandas.core.indexes.accessors import time: 1115 | 1115 | pandas.plotting._core import time: 967 | 967 | pandas.plotting._misc import time: 1487 | 3568 | pandas.plotting import time: 1187 | 1187 | pandas._libs.window import time: 5302 | 6489 | pandas._libs.window.aggregations import time: 2373 | 2373 | pandas.core.groupby.base import time: 1039 | 3412 | pandas.core.window.common import time: 3035 | 3035 | pandas._libs.window.indexers import time: 1913 | 4947 | pandas.core.window.indexers import time: 1370 | 1370 | pandas.core.window.numba_ import time: 3346 | 9662 | pandas.core.window.rolling import time: 1171 | 20731 | pandas.core.window.ewm import time: 1814 | 1814 | pandas.core.window.expanding import time: 1549 | 24092 | pandas.core.window import time: 5924 | 38122 | pandas.core.series import time: 16086 | 107416 | pandas.core.frame import time: 3193 | 3193 | pandas._libs.groupby import time: 2461 | 2461 | pandas._libs.reduction import time: 634 | 634 | pandas.core.groupby.categorical import time: 809 | 1442 | pandas.core.groupby.grouper import time: 1230 | 5131 | pandas.core.groupby.ops import time: 2699 | 11022 | pandas.core.groupby.groupby import time: 2238 | 120675 | pandas.core.groupby.generic import time: 705 | 121379 | pandas.core.groupby import time: 600 | 249267 | pandas.core.api import time: 573 | 573 | pandas.tseries.api import time: 1266 | 1266 | pandas.core.computation import time: 611 | 611 | pandas.core.computation.common import time: 1627 | 2238 | pandas.core.computation.align import time: 804 | 804 | pprint import time: 667 | 667 | pandas.compat.chainmap import time: 1342 | 2812 | pandas.core.computation.scope import time: 1083 | 3894 | pandas.core.computation.ops import time: 836 | 6968 | pandas.core.computation.engines import time: 1249 | 1249 | pandas.core.computation.parsing import time: 1746 | 2994 | pandas.core.computation.expr import time: 756 | 10717 | pandas.core.computation.eval import time: 1582 | 13564 | pandas.core.computation.api import time: 554 | 554 | pandas.core.reshape import time: 864 | 864 | pandas.core.reshape.concat import time: 741 | 741 | pandas.core.reshape.melt import time: 1146 | 1146 | pandas.core.reshape.merge import time: 832 | 832 | pandas.core.reshape.util import time: 1141 | 1973 | pandas.core.reshape.pivot import time: 735 | 735 | pandas.core.reshape.reshape import time: 599 | 599 | pandas.core.reshape.tile import time: 934 | 7543 | pandas.core.reshape.api import time: 571 | 571 | pandas.api.extensions import time: 1139 | 1139 | pandas.api.indexers import time: 731 | 731 | pandas.core.dtypes.api import time: 781 | 1511 | pandas.api.types import time: 542 | 3762 | pandas.api import time: 1173 | 1173 | pandas.util._print_versions import time: 694 | 694 | pandas.io.clipboards import time: 136 | 136 | backports_abc import time: 2362 | 2362 | _csv import time: 741 | 3103 | csv import time: 3599 | 6836 | pandas._libs.parsers import time: 571 | 571 | pandas.io.excel._util import time: 1166 | 1166 | pandas.io.date_converters import time: 20877 | 22042 | pandas.io.parsers import time: 752 | 752 | pandas.io.excel._odfreader import time: 744 | 744 | pandas.io.excel._openpyxl import time: 726 | 726 | pandas.io.excel._xlrd import time: 2210 | 2210 | pandas.io.excel._pyxlsb import time: 1183 | 35061 | pandas.io.excel._base import time: 2763 | 2763 | pandas._libs.json import time: 1335 | 4098 | pandas.io.excel._xlsxwriter import time: 682 | 682 | pandas.io.excel._xlwt import time: 505 | 40344 | pandas.io.excel import time: 557 | 557 | pandas.io.feather_format import time: 1103 | 1103 | pandas.io.gbq import time: 900 | 900 | pandas.io.html import time: 1152 | 1152 | pandas.io.json._normalize import time: 561 | 561 | pandas.io.json._table_schema import time: 1259 | 2971 | pandas.io.json._json import time: 882 | 3852 | pandas.io.json import time: 507 | 507 | pandas.io.orc import time: 633 | 633 | pandas.io.parquet import time: 952 | 952 | pandas.compat.pickle_compat import time: 588 | 1540 | pandas.io.pickle import time: 1338 | 1338 | pandas.core.computation.pytables import time: 2574 | 3911 | pandas.io.pytables import time: 572 | 572 | pandas.io.sas.sasreader import time: 885 | 1456 | pandas.io.sas import time: 562 | 562 | pandas.io.spss import time: 947 | 947 | pandas.io.sql import time: 1665 | 1665 | pandas.io.stata import time: 832 | 59496 | pandas.io.api import time: 807 | 807 | pandas.util._tester import time: 2674 | 2674 | pandas._libs.testing import time: 1508 | 4182 | pandas._testing import time: 497 | 4678 | pandas.testing import time: 604 | 604 | pandas._version import time: 4773 | 461450 | bokeh.core.property.wrappers import time: 1284 | 470545 | bokeh.core.has_props import time: 920 | 920 | bokeh.core.property.descriptors import time: 1229 | 476149 | bokeh.core.property.bases import time: 849 | 480320 | bokeh.core.property.any import time: 1412 | 1412 | bokeh.core.property.primitive import time: 643 | 2054 | bokeh.core.property.enum import time: 620 | 2674 | bokeh.core.property.auto import time: 1100 | 1100 | _bootlocale import time: 2953 | 2953 | _uuid import time: 6898 | 10950 | uuid import time: 4687 | 15637 | bokeh.util.serialization import time: 4098 | 4098 | bokeh.core.property.numeric import time: 1794 | 21528 | bokeh.core.property.container import time: 773 | 773 | bokeh.core.property.either import time: 876 | 876 | bokeh.core.property.string import time: 809 | 23984 | bokeh.core.property.color import time: 593 | 593 | bokeh.core.property.datetime import time: 1220 | 1220 | bokeh.core.property.instance import time: 1315 | 1315 | PIL._version import time: 2397 | 3712 | PIL import time: 717 | 717 | PIL.ImageMode import time: 1260 | 1260 | PIL.TiffTags import time: 975 | 975 | PIL._binary import time: 506 | 506 | PIL._util import time: 11346 | 11346 | PIL._imaging import time: 1165 | 1165 | cffi.lock import time: 630 | 630 | cffi.error import time: 850 | 850 | cffi.model import time: 2500 | 5143 | cffi.api import time: 1764 | 6906 | cffi import time: 1741 | 27159 | PIL.Image import time: 2269 | 29428 | bokeh.core.property.visual import time: 1057 | 32297 | bokeh.core.property.dataspec import time: 621 | 621 | bokeh.core.property.include import time: 570 | 570 | bokeh.core.property.json import time: 498 | 498 | bokeh.core.property.pandas import time: 372 | 372 | bokeh.core.property.struct import time: 823 | 823 | bokeh.core.property.validation import time: 1463 | 543619 | bokeh.core.properties import time: 672 | 672 | bokeh.core.json_encoder import time: 1066 | 1066 | bokeh.events import time: 849 | 849 | bokeh.themes._caliber import time: 495 | 495 | bokeh.themes._dark_minimal import time: 607 | 607 | bokeh.themes._light_minimal import time: 567 | 567 | bokeh.themes.theme import time: 694 | 3209 | bokeh.themes import time: 846 | 846 | bokeh.util.functions import time: 596 | 1441 | bokeh.util.callback_manager import time: 1041 | 7427 | bokeh.model import time: 4321 | 4321 | bokeh.core.property_mixins import time: 682 | 682 | bokeh.core.validation.check import time: 526 | 526 | bokeh.core.validation.decorators import time: 674 | 1881 | bokeh.core.validation import time: 713 | 713 | bokeh.core.validation.errors import time: 1321 | 1321 | bokeh.models.tickers import time: 1400 | 1400 | bokeh.models.glyph import time: 2095 | 2095 | bokeh.models.callbacks import time: 1018 | 1018 | bokeh.models.filters import time: 752 | 752 | bokeh.models.selections import time: 1944 | 5808 | bokeh.models.sources import time: 1432 | 7239 | bokeh.models.transforms import time: 1575 | 8814 | bokeh.models.mappers import time: 2189 | 2189 | bokeh.models.markers import time: 11664 | 24066 | bokeh.models.glyphs import time: 1619 | 27005 | bokeh.models.formatters import time: 817 | 817 | bokeh.models.graphs import time: 1187 | 1187 | bokeh.models.tiles import time: 1388 | 3391 | bokeh.models.renderers import time: 7455 | 44764 | bokeh.models.annotations import time: 1501 | 1501 | bokeh.models.arrow_heads import time: 2471 | 2471 | bokeh.models.axes import time: 786 | 786 | bokeh.models.expressions import time: 1153 | 1153 | bokeh.models.grids import time: 1433 | 1433 | bokeh.core.validation.warnings import time: 2320 | 3752 | bokeh.models.layouts import time: 1476 | 1476 | bokeh.models.ranges import time: 1170 | 1170 | bokeh.core.query import time: 918 | 918 | bokeh.models.scales import time: 4365 | 4365 | bokeh.models.tools import time: 1801 | 8252 | bokeh.models.plots import time: 1018 | 10746 | bokeh.models.map_plots import time: 1237 | 1237 | bokeh.models.textures import time: 1367 | 1367 | bokeh.models.widgets.icons import time: 645 | 645 | bokeh.models.widgets.widget import time: 1314 | 3326 | bokeh.models.widgets.buttons import time: 1249 | 1249 | bokeh.models.widgets.groups import time: 2863 | 2863 | bokeh.models.widgets.inputs import time: 776 | 776 | bokeh.models.widgets.markups import time: 1410 | 1410 | bokeh.models.widgets.panels import time: 8729 | 8729 | bokeh.models.widgets.sliders import time: 3761 | 3761 | bokeh.models.widgets.tables import time: 1953 | 24063 | bokeh.models.widgets import time: 1241 | 99136 | bokeh.models import time: 608 | 608 | bokeh.transform import time: 422 | 422 | bokeh.util.options import time: 533 | 533 | bokeh.plotting._docstring import time: 538 | 538 | bokeh.util.deprecation import time: 635 | 1173 | bokeh.plotting._legends import time: 437 | 1609 | bokeh.plotting._renderer import time: 380 | 2521 | bokeh.plotting._decorators import time: 567 | 567 | bokeh.plotting._graph import time: 647 | 647 | bokeh.plotting._plot import time: 406 | 406 | bokeh.plotting._stack import time: 3038 | 3038 | typing_extensions import time: 1016 | 4054 | bokeh.plotting._tools import time: 15820 | 1229134 | bokeh.plotting.figure import time: 1295 | 1295 | bokeh.plotting.gmap import time: 652 | 652 | bokeh.plotting.graph import time: 662 | 662 | markupsafe._compat import time: 2060 | 2060 | markupsafe._speedups import time: 3018 | 5740 | markupsafe import time: 931 | 931 | jinja2._compat import time: 1999 | 1999 | jinja2.utils import time: 1235 | 4165 | jinja2.bccache import time: 2231 | 2231 | jinja2.nodes import time: 991 | 991 | jinja2.exceptions import time: 761 | 761 | jinja2.visitor import time: 888 | 1648 | jinja2.idtracking import time: 932 | 932 | jinja2.optimizer import time: 1630 | 5201 | jinja2.compiler import time: 973 | 973 | jinja2.runtime import time: 1299 | 2271 | jinja2.filters import time: 673 | 673 | jinja2.tests import time: 505 | 3448 | jinja2.defaults import time: 5604 | 5604 | jinja2._identifier import time: 8046 | 13649 | jinja2.lexer import time: 914 | 914 | jinja2.parser import time: 1795 | 27236 | jinja2.environment import time: 752 | 752 | jinja2.loaders import time: 3581 | 41472 | jinja2 import time: 1795 | 1795 | encodings.unicode_escape import time: 40208 | 42003 | bokeh.core.templates import time: 669 | 669 | bokeh.util.datatypes import time: 1006 | 1006 | bokeh.document.events import time: 604 | 604 | bokeh.document.locking import time: 545 | 545 | bokeh.document.util import time: 1154 | 87449 | bokeh.document.document import time: 622 | 88071 | bokeh.document import time: 1381 | 1381 | bokeh.io.doc import time: 4601 | 4601 | bokeh.util.token import time: 5242 | 9842 | bokeh.resources import time: 1899 | 1899 | bokeh.util.compiler import time: 2693 | 4592 | bokeh.embed.bundle import time: 1412 | 1412 | html.entities import time: 889 | 2301 | html import time: 797 | 797 | bokeh.embed.util import time: 355 | 355 | bokeh.embed.wrappers import time: 1698 | 5148 | bokeh.embed.elements import time: 1024 | 20605 | bokeh.embed.server import time: 816 | 816 | bokeh.embed.standalone import time: 882 | 22302 | bokeh.embed import time: 525 | 525 | bokeh.io.util import time: 1022 | 23849 | bokeh.io.export import time: 539 | 539 | bokeh.io.state import time: 635 | 1173 | bokeh.io.notebook import time: 331 | 331 | bokeh.io.output import time: 341 | 341 | bokeh.io.saving import time: 1113 | 1113 | shlex import time: 948 | 2061 | webbrowser import time: 427 | 2487 | bokeh.util.browser import time: 513 | 3000 | bokeh.io.showing import time: 1180 | 31251 | bokeh.io import time: 631 | 631 | bokeh.layouts import time: 1537 | 2111955 | bokeh.plotting ```

EDIT: add spoiler tag to details

bryevdv commented 4 years ago

Ah, you already posted that, I was not familiar with the GH spoiler tag option.

samuelcolvin commented 4 years ago

Is there any chance you could make pandas imports lazy and only do the import when it's actually required?

bryevdv commented 4 years ago

not without technically making a breaking change. Module global DATETIME_TYPES is conditionally populated based on whether or not pandas is present:

https://github.com/bokeh/bokeh/blob/378a9fa6a9012122fae8c473ea4b001f3fcb22b4/bokeh/util/serialization.py#L61-L75

@samuelcolvin here is what I would say could help move this along. If you want to experiment with making all the imports conditional and see if that can improve things, that would be a great first step. You'd look to move all of these:

pd = import_optional('pandas')

of which there are maybe 10-12 place in the codebase.

For the one mentioned above, it's possible the import of bokeh.util.serialization can be made lazy (avoiding any breaking change altogether) or the DATETIME_TYPES could become a function as an experiment for now to see if the lazy pd works. Can you report back findings here?

samuelcolvin commented 4 years ago

https://github.com/samuelcolvin/notbook is the reason I was asking this, would love your feedback @bryevdv.

I'm pretty busy right now but I should think bokeh is great, I'll try and work on it when I get a chance.

bryevdv commented 2 years ago

Now that module getattr is an option its possible DATETIME_TYPES could even be handled without any breaking changed. Triaging to 3.0 to at least experiment.

bryevdv commented 2 years ago

With #11891 initial import times on branch-3.0 are down to ~350ms (from >1 s before) which is probably about the best we can do as long as numpy is an unconditional import (and I don't see a way to avoid that)

github-actions[bot] commented 1 week ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.