apple / turicreate

Turi Create simplifies the development of custom machine learning models.
BSD 3-Clause "New" or "Revised" License
11.2k stars 1.14k forks source link

Lazy import numpy in cy_flexible_type #2294

Closed guihao-liang closed 4 years ago

guihao-liang commented 5 years ago
import time:       804 |      23281 |   turicreate._deps
import time:       149 |        149 |   turicreate.version_info
import time:       172 |        172 |   turicreate.toolkits
import time:       230 |        230 |       urllib
import time:       230 |        230 |           fnmatch
import time:       109 |        109 |           errno
import time:       342 |        342 |           zlib
import time:       346 |        346 |             _compression
import time:       319 |        319 |             _bz2
import time:       978 |       1641 |           bz2
import time:       515 |        515 |             _lzma
import time:       361 |        875 |           lzma
import time:        52 |         52 |           pwd
import time:       295 |        295 |           grp
import time:       700 |       4240 |         shutil
import time:       345 |        345 |         binascii
import time:       869 |       5454 |       zipfile
import time:       150 |        150 |               org
import time:        26 |        176 |             org.python
import time:        26 |        201 |           org.python.core
import time:       455 |        656 |         copy
import time:      1014 |       1669 |       tarfile
import time:       277 |        277 |         _uuid
import time:       550 |        826 |       uuid
import time:       489 |        489 |         math
import time:       510 |        510 |         _datetime
import time:       939 |       1937 |       datetime
import time:       266 |        266 |       turicreate.util._sframe_generation
import time:       158 |        158 |       turicreate.util._type_checks
import time:       160 |        160 |       turicreate.util._progress_table_printer
import time:      2383 |       2383 |       configparser
import time:      1158 |       1158 |         signal
import time:       371 |        371 |         _posixsubprocess
import time:       391 |        391 |         select
import time:       687 |        687 |         selectors
import time:       627 |       3232 |       subprocess
import time:      3238 |      19549 |     turicreate.util
import time:       274 |      19822 |   turicreate.aggregate
import time:      1127 |       1127 |       turicreate.data_structures.image
import time:       290 |        290 |         turicreate._connect
import time:       170 |        170 |             turicreate._cython
import time:       455 |        455 |                       array
import time:      4515 |       4515 |                       turicreate._cython.cy_cpp_utils
import time:        71 |         71 |                       turicreate._cython.itertools
import time:        45 |         45 |                       turicreate._cython.datetime
import time:        42 |         42 |                       turicreate._cython.calendar
import time:       687 |        687 |                       calendar
import time:        55 |         55 |                       turicreate._cython.collections
import time:        44 |         44 |                       turicreate._cython.types
import time:        41 |         41 |                       turicreate._cython.decimal
import time:       546 |        546 |                           numbers
import time:       992 |       1538 |                         _decimal
import time:       239 |       1777 |                       decimal
import time:        56 |         56 |                       turicreate._cython.datetime
import time:        44 |         44 |                       turicreate._cython.datetime
import time:       314 |        314 |                         numpy._globals
import time:       171 |        171 |                         numpy.__config__
import time:       129 |        129 |                         numpy.version
import time:       126 |        126 |                         numpy._distributor_init
import time:       260 |        260 |                           numpy.core.info
import time:      4029 |       4029 |                               numpy.core._multiarray_umath
import time:       245 |        245 |                                   numpy.compat._inspect
import time:       155 |        155 |                                         nt
import time:       137 |        137 |                                         nt
import time:       123 |        123 |                                         nt
import time:       365 |        779 |                                       ntpath
import time:      1153 |       1153 |                                       urllib.parse
import time:       880 |       2811 |                                     pathlib
import time:       223 |       3034 |                                   numpy.compat.py3k
import time:       224 |       3502 |                                 numpy.compat
import time:        26 |       3527 |                               numpy.compat._inspect
import time:       293 |       7849 |                             numpy.core.overrides
import time:       429 |       8277 |                           numpy.core.multiarray
import time:       213 |        213 |                           numpy.core.umath
import time:       191 |        191 |                             numpy.core._string_helpers
import time:       189 |        189 |                               numpy.core._dtype
import time:       527 |        715 |                             numpy.core._type_aliases
import time:       340 |       1245 |                           numpy.core.numerictypes
import time:       517 |        517 |                                 _ctypes
import time:       291 |        291 |                                 ctypes._endian
import time:       986 |       1793 |                               ctypes
import time:       914 |       2707 |                             numpy.core._internal
import time:       122 |        122 |                             pickle5
import time:       352 |        352 |                               _compat_pickle
import time:       118 |        118 |                                   org
import time:        20 |        138 |                                 org.python
import time:        19 |        157 |                               org.python.core
import time:       432 |        432 |                               _pickle
import time:       777 |       1717 |                             pickle
import time:       172 |        172 |                               numpy.core._methods
import time:       462 |        633 |                             numpy.core.fromnumeric
import time:       577 |        577 |                             numpy.core.arrayprint
import time:       754 |       6509 |                           numpy.core.numeric
import time:       650 |        650 |                           numpy.core.defchararray
import time:       331 |        331 |                           numpy.core.records
import time:       186 |        186 |                           numpy.core.memmap
import time:       169 |        169 |                           numpy.core.function_base
import time:       151 |        151 |                           numpy.core.machar
import time:       258 |        258 |                           numpy.core.getlimits
import time:       213 |        213 |                           numpy.core.shape_base
import time:       207 |        207 |                           numpy.core.einsumfunc
import time:       678 |        678 |                             numpy.core._multiarray_tests
import time:      1444 |       2122 |                           numpy.core._add_newdocs
import time:       139 |        139 |                           numpy.core._dtype_ctypes
import time:       144 |        144 |                           numpy._pytesttester
import time:       631 |      21695 |                         numpy.core
import time:       289 |        289 |                           numpy.lib.info
import time:       223 |        223 |                             numpy.lib.ufunclike
import time:       291 |        513 |                           numpy.lib.type_check
import time:      1209 |       1209 |                                   _ast
import time:       411 |       1620 |                                 ast
import time:       202 |        202 |                                   numpy.linalg.info
import time:       308 |        308 |                                     numpy.lib.twodim_base
import time:       432 |        432 |                                     numpy.linalg.lapack_lite
import time:       712 |        712 |                                     numpy.linalg._umath_linalg
import time:       448 |       1898 |                                   numpy.linalg.linalg
import time:       190 |       2289 |                                 numpy.linalg
import time:       334 |       4241 |                               numpy.matrixlib.defmatrix
import time:       150 |       4391 |                             numpy.matrixlib
import time:       582 |        582 |                               numpy.lib.utils
import time:       237 |        237 |                               numpy.lib.histograms
import time:      1106 |       1924 |                             numpy.lib.function_base
import time:       270 |        270 |                             numpy.lib.stride_tricks
import time:       425 |       7008 |                           numpy.lib.index_tricks
import time:       222 |        222 |                           numpy.lib.mixins
import time:       282 |        282 |                           numpy.lib.nanfunctions
import time:       338 |        338 |                           numpy.lib.shape_base
import time:       220 |        220 |                           numpy.lib.scimath
import time:       403 |        403 |                           numpy.lib.polynomial
import time:       191 |        191 |                           numpy.lib.arraysetops
import time:       221 |        221 |                             numpy.lib.format
import time:       235 |        235 |                             numpy.lib._datasource
import time:       332 |        332 |                             numpy.lib._iotools
import time:       491 |       1278 |                           numpy.lib.npyio
import time:       240 |        240 |                           numpy.lib.financial
import time:       162 |        162 |                           numpy.lib.arrayterator
import time:       207 |        207 |                           numpy.lib.arraypad
import time:       149 |        149 |                           numpy.lib._version
import time:       421 |      11917 |                         numpy.lib
import time:       179 |        179 |                           numpy.fft.info
import time:       236 |        236 |                             numpy.fft.fftpack_lite
import time:       194 |        194 |                             numpy.fft.helper
import time:       222 |        651 |                           numpy.fft.fftpack
import time:       153 |        982 |                         numpy.fft
import time:       214 |        214 |                             numpy.polynomial.polyutils
import time:       267 |        267 |                             numpy.polynomial._polybase
import time:       423 |        903 |                           numpy.polynomial.polynomial
import time:       330 |        330 |                           numpy.polynomial.chebyshev
import time:       318 |        318 |                           numpy.polynomial.legendre
import time:       326 |        326 |                           numpy.polynomial.hermite
import time:       277 |        277 |                           numpy.polynomial.hermite_e
import time:       350 |        350 |                           numpy.polynomial.laguerre
import time:       219 |       2721 |                         numpy.polynomial
import time:      2090 |       2090 |                           numpy.random.mtrand
import time:       288 |       2377 |                         numpy.random
import time:       483 |        483 |                         numpy.ctypeslib
import time:      1281 |       1281 |                             textwrap
import time:      2379 |       3659 |                           numpy.ma.core
import time:       619 |        619 |                           numpy.ma.extras
import time:       273 |       4550 |                         numpy.ma
import time:       240 |        240 |                               unittest.util
import time:       279 |        519 |                             unittest.result
import time:       568 |        568 |                               difflib
import time:       328 |        328 |                               pprint
import time:      1032 |       1927 |                             unittest.case
import time:       234 |        234 |                             unittest.suite
import time:       458 |        458 |                             unittest.loader
import time:       845 |        845 |                               argparse
import time:       159 |        159 |                                 unittest.signals
import time:       218 |        376 |                               unittest.runner
import time:       228 |       1448 |                             unittest.main
import time:       265 |       4848 |                           unittest
import time:       187 |        187 |                             numpy.testing._private
import time:        46 |         46 |                             gc
import time:      2048 |       2048 |                                   _hashlib
import time:       286 |        286 |                                   _blake2
import time:       286 |        286 |                                   _sha3
import time:       277 |       2895 |                                 hashlib
import time:       300 |        300 |                                   _bisect
import time:       175 |        474 |                                 bisect
import time:       352 |        352 |                                 _random
import time:       542 |       4261 |                               random
import time:       420 |       4681 |                             tempfile
import time:       631 |       5542 |                           numpy.testing._private.utils
import time:       192 |        192 |                           numpy.testing._private.decorators
import time:       244 |        244 |                           numpy.testing._private.nosetester
import time:       210 |      11034 |                         numpy.testing
import time:      1651 |      58142 |                       numpy
import time:        58 |         58 |                       turicreate._cython.builtins
import time:        42 |         42 |                       turicreate._cython.six
import time:      5726 |      71794 |                     turicreate._cython.cy_flexible_type
import time:      4347 |       4347 |                     turicreate._cython.cy_dataframe
import time:      4631 |      80771 |                   turicreate._cython.cy_sframe
import time:       454 |        454 |                       dis
import time:       378 |        378 |                       imp
import time:       442 |       1273 |                     turicreate.util._cloudpickle
import time:      4109 |       5381 |                   turicreate._cython.cy_graph
import time:        46 |         46 |                   turicreate._cython.types
import time:      4571 |      90768 |                 turicreate._cython.cy_variant
import time:      4627 |      95395 |               turicreate._cython.cy_model
import time:      3704 |      99098 |             turicreate._cython.cy_sarray
import time:        40 |         40 |             turicreate._cython.inspect
import time:      1371 |       1371 |             inspect
import time:        48 |         48 |             turicreate._cython.pickle
import time:     20744 |     121469 |           turicreate._cython.cy_unity
import time:      2831 |       2831 |               platform
import time:      5695 |       8525 |             turicreate.util._config
import time:       146 |        146 |               turicreate._scripts
import time:       233 |        233 |               turicreate._scripts._pylambda_worker
import time:       429 |        807 |             turicreate._sys_util
import time:        59 |         59 |             turicreate._cython.logging
import time:        41 |         41 |             turicreate._cython.os
import time:        36 |         36 |             turicreate._cython.sys
import time:       139 |        139 |             turicreate._cython.python_printer_callback
import time:      4741 |      14344 |           turicreate._cython.cy_server
import time:       831 |        831 |           decorator
import time:       448 |     137091 |         turicreate._connect.main
import time:       263 |        263 |         turicreate._cython.context
import time:       466 |        466 |                     _json
import time:       442 |        907 |                   json.scanner
import time:       529 |       1436 |                 json.decoder
import time:       433 |        433 |                 json.encoder
import time:       263 |       2131 |               json
import time:       231 |       2361 |             turicreate.visualization._plot
import time:       285 |       2646 |           turicreate.visualization.show
import time:       163 |       2809 |         turicreate.visualization
import time:       829 |        829 |         turicreate.data_structures.sarray
import time:       179 |        179 |         turicreate.data_structures.grouped_sframe
import time:       687 |        687 |           _csv
import time:       862 |       1549 |         csv
import time:      1495 |     144502 |       turicreate.data_structures.sframe
import time:       368 |        368 |         turicreate.data_structures.gframe
import time:       605 |        973 |       turicreate.data_structures.sgraph
import time:      4978 |       4978 |         turicreate._cython.cy_sketch
import time:       316 |       5293 |       turicreate.data_structures.sketch
import time:       431 |     152323 |     turicreate.data_structures
import time:        47 |     152369 |   turicreate.data_structures.sgraph
import time:       225 |        225 |   turicreate.data_structures.sarray_builder
import time:       186 |        186 |   turicreate.data_structures.sframe_builder
import time:       288 |        288 |   turicreate.toolkits.clustering
import time:       180 |        180 |   turicreate.toolkits.graph_analytics
import time:       151 |        151 |       turicreate.toolkits._main
import time:       482 |        482 |         turicreate.extensions
import time:       301 |        301 |         turicreate.toolkits._internal_utils
import time:       201 |        201 |         turicreate.util._file_util
import time:      1162 |       2144 |       turicreate.toolkits._model
import time:       498 |       2792 |     turicreate.toolkits.recommender.util
import time:       182 |       2974 |   turicreate.toolkits.recommender
import time:       284 |        284 |       turicreate.toolkits._supervised_learning
import time:       205 |        489 |     turicreate.toolkits.regression._regression
import time:       212 |        212 |     turicreate.toolkits.regression.linear_regression
import time:       203 |        203 |       turicreate.toolkits._tree_model_mixin
import time:       225 |        427 |     turicreate.toolkits.regression.boosted_trees_regression
import time:       227 |        227 |     turicreate.toolkits.regression.random_forest_regression
import time:       259 |        259 |     turicreate.toolkits.regression.decision_tree_regression
import time:       235 |       1848 |   turicreate.toolkits.regression
import time:       233 |        233 |     turicreate.toolkits.classifier._classifier
import time:       285 |        517 |   turicreate.toolkits.classifier
import time:       286 |        286 |   turicreate.toolkits.classifier.decision_tree_classifier
import time:       154 |        154 |   turicreate.toolkits.image_analysis
import time:       405 |        405 |       multiprocessing.process
import time:       745 |        745 |           _socket
import time:      1966 |       2711 |         socket
import time:       385 |       3096 |       multiprocessing.reduction
import time:       823 |       4322 |     multiprocessing.context
import time:       467 |       4789 |   multiprocessing
import time:       228 |        228 |     certifi.core
import time:       320 |        547 |   certifi
import time:    101215 |     309259 | turicreate
TobyRoseman commented 5 years ago

@Jarvi-Izana - what are the two integer columns? Is one system time and the other wall time?

guihao-liang commented 5 years ago

Aha, I deleted some non-relevant imports and the header.

import time: self [us] | cumulative | imported package
guihao-liang commented 4 years ago

no plan.